SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need Help with Advance PHP FORM function

    Hello,
    PLEASE i want to know how to code form to send mail to the emails from the Attached File..... I have this as sample please help....
    PHP Code:
     $headers  "From: My site<noreply@example.com>\r\n"
     
    $headers .= "Reply-To: info@example.com\r\n"
     
    $headers .= "Return-Path: info@example.com\r\n"
     
    $headers .= "X-Mailer: PHP v".phpversion().$eol
     
    $headers .= 'MIME-Version: 1.0' "\n"
     
    $headers .= "X-Priority: 1 (Highest)\n";
     
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n"
     
    $headers .= 'To: Mary <mary@example.com>' "\r\n";
     
    $headers .= 'Bcc: birthdaycheck@example.com' "\r\n"/* I want to have more BCC email, the email are save in a text.. Please how can I include it.. thank */
    $subject 'About My site';
    $message "<html> 
      <body bgcolor=\"#DCEEFC\"> 
        <center> 
            <b>  Lol!!! I am reciving HTML email......</b> <br> 
            <font color=\"red\">Thanks Mohammed!</font> <br> 
            <a target=_blank  href= "
    www.maaking.com">maaking.com</a> 
        </center> 
          <br><br>*** Now you Can send HTML Email <br> Regards<br>MOhammed Ahmed - Palestine 
      </body> 
    </html>"


    mail ($headers$message$subject);
    header ('location: thank.html');
    exit(); 
    Thanks

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $file file_get_contents("test.txt");

    $pattern "/([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}/ix";

    preg_match_all($pattern$file$matches);


    // multiple recipients
    $to 'aidan@example.com' ', '// note the comma
    $to .= 'wez@example.com';

    // subject
    $subject 'Birthday Reminders for August';

    // message
    $message 
    <html> 
    <head> 
      <title>Birthday Reminders for August</title> 
    </head> 
    <body> 
      <p>Here are the birthdays upcoming in August!</p> 
      <table> 
        <tr> 
          <th>Person</th><th>Day</th><th>Month</th><th>Year</th> 
        </tr> 
        <tr> 
          <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> 
        </tr> 
        <tr> 
          <td>Sally</td><td>17th</td><td>August</td><td>1973</td> 
        </tr> 
      </table> 
    </body> 
    </html> 
    '
    ;

    // To send HTML mail, the Content-type header must be set
    $headers 'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

    // Additional headers
    $headers .= 'To: Mary <mary@example.com>' "\r\n";
    $headers .= 'From: Birthday Reminder <birthday@example.com>' "\r\n";
    $headers .= 'Cc: birthdayarchive@example.com' "\r\n";
    $headers .= 'Bcc: ' implode(","$matches[0]) . "\r\n";

    // Mail it
    mail($to$subject$message$headers); 
    and the txt file:
    Code:
    test@example.com test2@example.com, test3@example.com
    test4@example.com  test5@gmail.com
    my mobile portal
    ghiris.ro

  3. #3
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank so much for your Reply... Please I will like to know how to include the the (File.txt ) into the File.... Can it be attached??? Thanks

  4. #4
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the test.txt is just an example, you can change it.
    PHP Code:
    // change test.txt to FIle.txt or something else
    // file_get_contents  Reads entire file into a string
    $file file_get_contents("test.txt"); 
    my mobile portal
    ghiris.ro


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •