I receive this error:
PHP Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in D:\clients\ebiblecommentary.com\concordia-seminary.ca\concordia-seminary.ca_demo\register.php on line 464
Both of my mail() uses fail, and I'm not sure why. I've followed the same syntax before on this my server and not had a problem.
My code is below:
$email = $_SESSION['email'];
$to = $email;
$subject = "Thank you " . $_POST['fname'] . " for registering with CLTS.";
$headers = "From: CLTS Online Application System\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1" . "\r\n";
$msg = <<<EOHTML
<div style="font-size: 14pt; font-weight: bold; color: #f93;">
Thank you {$_SESSION['fname']} {$_SESSION['lname']}, your registration is complete!
</div>
<br />
Your account is now active. You may now begin your application process for your the academic programme you wish to enter. If you encounter any problems during the process please contact the Web Adminstrator at <a href="{webmaster}">{$webmaster}</a>
<br />
<font style="font-szie: 12pt; font-weight: bold; color: black;">Remember:</font> At no time will anyone from the Seminary ask you for your username or password. Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one.
<br />
<br />
<div style="font-szie: 12pt; font-weight: bold; color: black;">
Below is your account information. Please do not loose this email.
</div>
<b>Your Account Number</b>: {$account_num}
<br />
<b>Your Username</b>: {$_SESSION['email']}
<br />
<b>Your Password</b>: {$_SESSION['password']}
EOHTML;
$message = "<html>" . $msg . "</html>";
mail($to, $subject, $message, $headers) or die("<font color=\"red\">ERROR!</font> Please contact the webmaster.<br /> Sorry for the inconvenience.");
//This informs the Webmaster
$to = $webmaster;
$subject = $_POST['fname'] . " " . $_POST['lname'] . " has registered an account.";
$headers = "From: CLTS Online Application System\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1" . "\r\n";
$msg = <<<EOHTML
<div style="font-size: 14pt; font-weight: bold; color: #f93;">
{$_SESSION['prefix']} {$_SESSION['fname']} {$_SESSION['lname']} has registered an account with the Seminary.
</div>
Their CLTS Application System Account Number is <b>{$test}</b>
<br />
The Application System has created the following applications for them:
{$apps}
EOHTML;
$message = "<html>" . $msg . "</html>";
mail($to, $subject, $message, $headers) or die("<font color=\"red\">ERROR!</font> Please contact the webmaster.<br /> Sorry for the inconvenience.");