I set up a system where an email is sent out to the customer when you input their info into the system.... nothing fancy. I simply need to be notified if the email address that i am sending to is not valid (old email, mistyped, ect....).
i understand that php mail() funtion should be able to hand this either using the fifth parameter '-f' myemail@gmail.com
however when i do this- even if the $to email address is valid the email is not sent, and i get and error message at the "myemail@gmail.com" account telling me that the $to email adress is not valid- although it is.
im also a little confused bc i looked around and it appears you can also use additional headers to handle bounce back emails. what is the best way to do this. - also do i need to change some settings on my server. this is hosted with HostGator.
$mailto="whoever@gmail.com";
$subject="testing17";
$message= 'hello person this is just a testing message';
code
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: th718522@gmail.com' . "\r\n";
$returnaddress="th718522@gmail.com";
$mail_check=mail($mailto,$subject, $message, $headers,'-f'.$returnaddress);
|