Afficher un message
Vieux 17/09/2007, 08h24   #8
Manuel Lemos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Send a mail without going to spam

Hello,

on 09/16/2007 12:27 PM RageARC said the following:
> I've made a script that sends mails, and it sends mails correctly for
> gMail, but not for Hotmail. What happens is that on Hotmail the mails
> are not even received! Nor on spam box, nor on inbox.
>
> $headers = "From: $from\r\n";
> $headers .= "Content-type: text/html\r\n";
>
> mail($to, $subject, $message, $headers);
>
> This is the important info on the mail. The subject is a string, the
> $to and the $from are emails and the $message is HTML.
> ?>


You should never send HTML only messages. You can send HTML messages if
they have an alternative text part, like any regular mail program. Since
you do not do that, Hotmail correctly assumes you are not using a
regular mail program, and considers your message as junk.

To send HTML messages with an alternative text part, you need to compose
a multipart/alternative message and include both the text part and the
HTML part. This is a bit tricky to do manually. I use this MIME message
composing and sending class. Take a look at the example script
test_simple_html_mail_message.php .

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
  Réponse avec citation
 
Page generated in 0,05157 seconds with 9 queries