Page 1 of 1

mail

Posted: Thu Aug 12, 2004 8:18 am
by mastaoneil
hi im having trouble sending email from php to my hotmail account

<?php
$to = "mastaoneil@hotmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body))
{
echo("<p>Message sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
?>

ive tryed it from a webhost but i get no email and it says Message delivery failed...

any1 help

cheers

Posted: Thu Aug 12, 2004 10:41 am
by feyd
send an email to that account, or better yet, several emails from differing accounts to that one. Get the headers from each of the emails that get through, and not into the junk folder. Compare the headers used by all of them. The ones that are in the same syntaxes are likely what's making it work.

the mail function is failing off your server provider, denying the email going out.. so you may need to check with them for what is required to send an email through their system. (Probably Reply-To and Return-Path)

Posted: Thu Aug 12, 2004 1:42 pm
by mastaoneil
send an email to that account, or better yet, several emails from differing accounts to that one. Get the headers from each of the emails that get through, and not into the junk folder. Compare the headers used by all of them. The ones that are in the same syntaxes are likely what's making it work.

how do i get the headers?

Posted: Thu Aug 12, 2004 2:08 pm
by feyd
viewtopic.php?t=22964&start=3

read the first post on that page...

Posted: Thu Aug 12, 2004 2:29 pm
by mastaoneil
but there is no email sent to me hotmail account so what should i do

Posted: Thu Aug 12, 2004 2:38 pm
by feyd
send an email from your own account, to see what headers get through.. if you have other email accounts through other services, send some email with those accounts too. That way you can compare which headers are getting it through...

Posted: Fri Aug 13, 2004 2:24 pm
by mastaoneil
then wt do i do with the headers?

Posted: Fri Aug 13, 2004 2:25 pm
by feyd
feyd wrote:Compare the headers used by all of them. The ones that are in the same syntaxes are likely what's making it work.

Posted: Fri Aug 13, 2004 2:53 pm
by mastaoneil
do i have to run my own smtp server? and can i try alternative ways because i wont be hosting my site on my pc?

Posted: Fri Aug 13, 2004 2:54 pm
by feyd
what does that have to do with comparing the headers?

Posted: Fri Aug 13, 2004 3:25 pm
by mastaoneil
wts comparing headers got to do with sendin mail with php im not any gettin any mail sent

Posted: Fri Aug 13, 2004 3:31 pm
by feyd
to make sure you're setting the right headers for the server to be able to send, normally..