Hello everybody, My probleme is when i send an email using the integrated php mail fuction.. it go to junkmail.. is there any method to solve this probleme ? i heared about using good headers.. i used alot of examples but none is working Can you please help with this ! Thank You.
You need the from address to be the same as the sendmail address in the php.ini file or big ISPs will indeed junk it.
You probably should send the correct email headers, which you should be able to recycle from phpmailer (I'm not sure). $eol="\n"; $emailsubject="Here's An Email From Your Site-".date("Y/m/d H:i:s"); $headers = 'From: '.$from.' <'.$email.'>'.$eol; $headers .= 'Reply-To: '.$from.' <'.$email.'>'.$eol; $headers .= 'Return-Path: '.$from.' <'.$email.'>'.$eol; $headers .= "Message-ID: < TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // This helps avoid spam filters mail($emailaddress, $emailsubject, $msg, $headers); Code (markup): just give a value to the variables and it should work.
I've had good luck using these headers added on: $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* additional headers */ $headers .= "From: your site email address \r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); best, Jan