problems with sending email
Posted: Tue May 15, 2007 9:54 pm
Hi there,
I’ve written a simple mailout script. If appears to work fine for some people, appears to fail with others. The fails are with clients inside Uni’s and Corps ... so I’m wondering if I’m getting spam filtered or something alike. I include my code below. I would greatly appreciate any comments on how I may improve it.
Thanks
Giles
I’ve written a simple mailout script. If appears to work fine for some people, appears to fail with others. The fails are with clients inside Uni’s and Corps ... so I’m wondering if I’m getting spam filtered or something alike. I include my code below. I would greatly appreciate any comments on how I may improve it.
Thanks
Giles
Code: Select all
$to = $email;
$subject = "the subject";
$from = "my outgoing address";
$headers = "From: $from";
$headers.= "Content-Type: text/html; charset=ISO-8859-1 ";
$headers .= "MIME-Version: 1.0 ";
$body = "Dear " . $firstname . " " . $surname . ",
my message goes here
" . "Your username is : " . $username . "
" . "Your password is : " . $password;
this is a comment reinserted from the author
/*notice there aren't any \r\n after the second two header additions.
This is what made this version work correctly*/
mail($to,$subject,$body,$headers);