Page 1 of 1

mail command not working, seeing it as SPAM?

Posted: Tue Aug 08, 2006 5:44 am
by matharding
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi everybody I'm new here, and new to PHP too, I'm having trouble with the mail function where the mail reaches my email address fine in testing but when I change it to the clients address it never gets delivered.

Heres my code

Code: Select all

$to = "Steve.Nicholls@cornishvenning.co.uk"; 
$subject = "NEW QUOTE";
$headers = 'From: mat@t2design.net' . "\r\n" .
    'Reply-To: mat@t2design.net' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
$body = "QUOTE DETAILS\n"."\n"."FULL NAME\n".$full_name."\n"."\nADDRESS\n".$address."\n"."\nTOWN\CITY\n".$town."\n"."\nPOSTCODE\n".$postcode."\n"."\nCOUNTRY\n".$country."\n"."\nEMAIL\n".$email."\n"."\nTELEPHONE\n".$telephone."\n"."\nFAX\n".$fax."\n"."\n\nJOINT NAME\n".$joint."\n"."\nSECOND NAME\n".$second_fullname."\n\n";
$body .= "CONTACT TIME\n".$best_time."\n"."\nCONTACT METHOD\n".$respond."\n"."\nBUYING PRICE\n".$purchase_price."\n"."\nOWNER OCCUPATION\n".$own_occupation."\n"."\nMORTGAGE\n".$buy_mortgage."\n"."\nPROPERTY TYPE\n".$purchase_property."\n"."\nAREA\n".$buy_area."\n"."\nEXTRA INFO\n".$buy_info."\n"."\nSALE PRICE\n".$sale_price."\n"."\nPERSONAL RESIDENCE\n".$pers_residence."\n"."\nOWNER OCCUPATION\n".$own_occupation."\n"."\nHOW MANY MORTGAGES\n".$sell_mortgages."\n"."\nPROPERTY TYPE\n".$sell_property."\n"."\nAREA\n".$sell_area."\n"."\nEXTRA INFO\n".$pers_residence;
mail($to, $subject, $body, $headers);
I'm guessing it's something to do with the headers as my mail server accepts the mail as fine. Could it also be some sort of whitelist checking going on at my clients mail server that is treating the mail as spam?

Hope somebody can help, the mail command is brilliant when it works!


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Aug 08, 2006 5:56 am
by s.dot
Not sure, really. Could be a number of things. Check that your mail IS being sent

Code: Select all

if(mail())
{
   echo 'sent';
} else
{
   echo 'could not send';
}
Check your DNS settings, http://www.dnsreport.com.
Also, does your mail server have an SPF record?

Posted: Tue Aug 08, 2006 6:35 am
by Chris Corbyn
Are passing a correct "From" address?

Posted: Tue Aug 08, 2006 7:00 am
by matharding
Thanks, I shall post using the appropriate format next time, sorry about that.

Yeah the email From address is fine so that wont be the problem.

Ill try the email send check and the DNS settings too, thanks!