Mail() Function no error but no email
Posted: Wed Mar 19, 2008 6:43 am
I am using the mail function to send an email autonatically after a user has subscirbed to my newsletter. The script makes no error but no email is sent. Thank you in advance for your help
Below is the code
*$to = $email;// Defines above
$subject = "SXX Newsletter";
$message = "Hello! Welcome to our newsletter.";
$from = "xxxxx@xxxxxxxx.com";
$headers = "From: $from";
$success = mail($to, $subject, $message, $headers);
if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from";
// The email is always returns a success flag
Below is the code
*$to = $email;// Defines above
$subject = "SXX Newsletter";
$message = "Hello! Welcome to our newsletter.";
$from = "xxxxx@xxxxxxxx.com";
$headers = "From: $from";
$success = mail($to, $subject, $message, $headers);
if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from";
// The email is always returns a success flag