RSS Feed for This PostCurrent Article

What type of headers have to add in the mail function in which file a attached?


Trackback URL

  1. 1 Comment(s)

  2. By sudha on Sep 5, 2008 | Reply

    <?php
    // multiple recipients
    $to = ‘aidan@example.com’ . ‘, ‘; // note the comma
    $to .= ‘wez@example.com’;

    // subject
    $subject = ‘Birthday Reminders for August’;

    // message
    $message = ‘

    Birthday Reminders for August

    Here are the birthdays upcoming in August!

    PersonDayMonthYear

    Joe3rdAugust1970

    Sally17thAugust1973

    ‘;

    // 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 , Kelly ‘ . “\r\n”;
    $headers .= ‘From: Birthday Reminder ‘ . “\r\n”;
    $headers .= ‘Cc: birthdayarchive@example.com‘ . “\r\n”;
    $headers .= ‘Bcc: birthdaycheck@example.com‘ . “\r\n”;

    // Mail it
    mail($to, $subject, $message, $headers);
    ?>

Post a Comment