You are here: Re: Send a mail without going to spam « PHP Programming Language « IT news, forums, messages
Re: Send a mail without going to spam

Posted by Manuel Lemos on 09/17/07 07:24

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация