views:

991

answers:

3
mail($to, $subject, $message, $headers);

the $header is:

From: [email protected]
Reply-To: [email protected]
Content-Type: text/html; charset=iso-8859-1
X-Mailer: PHP/5.2.5
MIME-Version: 1.0

I built $header with those line and I changed the order in every way, putting the Mime in the beginning, at the end, moving the from and reply around adding and deleting the X-mailer line. The results are the same. Gmail and yahoo are fine and the email is an empty attachment when set to outlook 2003.

Any thoughts?

sdfor

+1  A: 

Personnally, i prefer using phpmailer, available on sourceforge. It offers a much more robust mailing solution. I use it to send our email newsletter. Very reliable.

pixeline
A: 

Try adding [email protected] to the end of 'From: ...'. This email should be an actual email address on the server. Try checking your spam folder with what you have.

Fiarr
A: 

thanks for the thoughts. I tried phpMailer and got stuck on a "Could not instantiate mail function" error. I posted a question about that too.

But I figured out the problem. Outlook requires a doctype and that the HTML be correct. gmail will take almost anything. \

The following works!

//the message:

HTML EMAIL

//the headers $headers = "From: $from\n" $headers .= "Reply-To: $replyto\n" $header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";

// the mail call mail($to, $subject, $message, $headers);

sdfor
Try Swiftmail as well, it works very well.
Blair McMillan