Code: Select all
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";Moderator: General Moderators
Code: Select all
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";mail() wrote:Code: Select all
<?php /* recipients */ $to = "mary@example.com" . ", " ; // note the comma $to .= "kelly@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, you can set the Content-type header. */ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; // <-------- HERE /* additional headers */ $headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n"; $headers .= "From: Birthday Reminder <birthday@example.com>\r\n"; $headers .= "Cc: birthdayarchive@example.com\r\n"; $headers .= "Bcc: birthdaycheck@example.com\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); ?>
So am I. I am no expert on Spam-filters, but flagging an email as spam simply because its HTML would pretty much defeat the purpose of spam-filtering to my mind.pickle wrote:I don't know about you, but I'm referring to server-based spam filters, such as Spam-Assasin, or Gee-Whiz. I know for a fact that an email consisting entirely of HTML gets an email flagged high as possible SPAM, although it doesn't guarantee. Client side spam filters might act differently though.
Code: Select all
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: "".$myname."" <".$myemail.">\n";I should clarify that an email consisting only of HTML will not get automatically flagged as SPAM because of that fact. Say, for example, an email needs a score of 4 to become SPAM. Spam filters will generally (although this is modifiable) give an email a score of 3 based on the HTML.patrikG wrote: So am I. I am no expert on Spam-filters, but flagging an email as spam simply because its HTML would pretty much defeat the purpose of spam-filtering to my mind.
Code: Select all
Mime-Version: 1.0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit //<---- I just checked the properties on one i just gotCode: Select all
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "Content-Transfer-Encoding: 7bit\n";
/* additional headers */
$headers .= 'To: '.$name.' <'.$toadr.">\r\n";
$headers .= 'From: '.$row['Firstname'].' '.$row['Lastname'].' <'.$fromadr.">\r\n";
$headers .= "Cc: ".$cc."\r\n";
$headers .= "Bcc: ".$bcc."\r\n";
ini_set('sendmail_from', $fromadr );
mail($toadr,$subj,$message,$headers);Code: Select all
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: php\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
/* additional headers */
$headers .= 'To: '.$name.' <'.$toadr.">\r\n";
$headers .= 'From: '.$row['Firstname'].' '.$row['Lastname'].' <'.$fromadr.">\r\n";
$headers .= "Cc: ".$cc."\r\n";
$headers .= "Bcc: ".$bcc."\r\n";
ini_set('sendmail_from', $fromadr );
mail($toadr,$subj,$message,$headers);