What type of headers have to add in the mail function in which file a attached?
By admin on Apr 10, 2007 in PHP Interview Questions
Java Interview Questions | IT interview questions | Software Testing Interview questions | .Net Interview Questions | Job Interview Questions & Answers | Tough Interview Questions | Technology Interview Questions | Tech Interview Questions | Testing Interview Questions | SAP Interview Questions | ABAP Interview Questions | Data Warehousing Interview Questions
Current ArticleBy admin on Apr 10, 2007 in PHP Interview Questions
1 Comment(s)
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);
?>