Sending HTML mail
Moderator: General Moderators
Sending HTML mail
Dear All,
I'm programming my sendmail form on my company website to send a standardised formatted e-mail with company logo and signature. However, some e-mail reading systems don't support HTML e-mails - is there any general rule to follow regarding sending HTML, or any way of detecting if the destination address can read HTML email (a longshot I know, but you never know).
Many thanks
Mark
I'm programming my sendmail form on my company website to send a standardised formatted e-mail with company logo and signature. However, some e-mail reading systems don't support HTML e-mails - is there any general rule to follow regarding sending HTML, or any way of detecting if the destination address can read HTML email (a longshot I know, but you never know).
Many thanks
Mark
Sending HTML mail is very dicey, as most anti-spam filters tag email consisting of only html very high. After that, it's very hard to not get tagged as SPAM. IMHO, I'd forget about the HTML email and just send a text email.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
In my experience that's not the case and, thinking about it, spam-filter live from being as precise as can be when it comes to spam. Thus, filtering because of a content-type would make no sense.pickle wrote:Sending HTML mail is very dicey, as most anti-spam filters tag email consisting of only html very high. After that, it's very hard to not get tagged as SPAM. IMHO, I'd forget about the HTML email and just send a text email.
In fact, even most private emails I receive are HTML.
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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Hi
I've actually done the HTML mailing part myself customised. I've just send an e-mail with HTML code, with subject/body/company address text all taken from external variables and inserted into the message text.
My HTML e-mail works exactly as planned from my hotmail account, but when I look on Outlook, it comes up as text (just plain text HTML code) - despite the fact that it has <HTML></HTML> tags as required.
Any ideas?
Mark
I've actually done the HTML mailing part myself customised. I've just send an e-mail with HTML code, with subject/body/company address text all taken from external variables and inserted into the message text.
My HTML e-mail works exactly as planned from my hotmail account, but when I look on Outlook, it comes up as text (just plain text HTML code) - despite the fact that it has <HTML></HTML> tags as required.
Any ideas?
Mark
why doesn't anybody google any mroe?
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";- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
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.