ulteriormotif
Technical User
I have a website hosted on "SiteHost1", but the email is handled by "MailHost2" through an MX redirect.
General email is working fine and dandy.
The problem is that the PHP Mail script that I use to send emails to new users I have registered on the site is no longer working. In short emails are not arriving to the address they are sent to, but no errors are generated - the new member is being inserted into the database, and I am getting my on-screen confirmation that the email has been sent (see end of posted code), but it never arrives.
It worked fine prior to the MX redirect being put in place, and the identical code continues to work fine on another site I have where sitehost and mailhost are one and the same.
I am assuming therefore that it's likely something to do with the email being hosted remotely?
The following is the portion of my php code that sends the email, though as stated this has been working fine until now.
----------------------------------------------------------
(get the info and insert in the database after error checking, etc, then send the following email
$userid = mysql_insert_id();
$subject = "Your membership at example.com";
$myname = "Mysite Webmaster";
$message = "<html>
<head>
</head>
<body>Dear $first_name $last_name, <p>
A user account has been created in your name at example.com.<p>
You are two steps away from logging in and accessing our exclusive members area.<p>
To activate your membership, please click <b><a href=\"
Once you activate your membership, you will be able to log in with the following information:<p>
Username: $newusername<br>
Password: $random_password<p>
Thanks!<br>
Webmaster<p>
This is an automated response. Please do not reply </body></html>";
mail($email_address, $subject, $message,
"MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nFrom: $myname<webmaster@example.com>n
X-Mailer: PHP/" . phpversion());
echo 'Membership information has been mailed to the new user\'s email address. User should check their email and follow the directions!<p><a href=adm_newuser.php>Register another new user</a>';
---------------------------------------------------------
help?
General email is working fine and dandy.
The problem is that the PHP Mail script that I use to send emails to new users I have registered on the site is no longer working. In short emails are not arriving to the address they are sent to, but no errors are generated - the new member is being inserted into the database, and I am getting my on-screen confirmation that the email has been sent (see end of posted code), but it never arrives.
It worked fine prior to the MX redirect being put in place, and the identical code continues to work fine on another site I have where sitehost and mailhost are one and the same.
I am assuming therefore that it's likely something to do with the email being hosted remotely?
The following is the portion of my php code that sends the email, though as stated this has been working fine until now.
----------------------------------------------------------
(get the info and insert in the database after error checking, etc, then send the following email
$userid = mysql_insert_id();
$subject = "Your membership at example.com";
$myname = "Mysite Webmaster";
$message = "<html>
<head>
</head>
<body>Dear $first_name $last_name, <p>
A user account has been created in your name at example.com.<p>
You are two steps away from logging in and accessing our exclusive members area.<p>
To activate your membership, please click <b><a href=\"
Once you activate your membership, you will be able to log in with the following information:<p>
Username: $newusername<br>
Password: $random_password<p>
Thanks!<br>
Webmaster<p>
This is an automated response. Please do not reply </body></html>";
mail($email_address, $subject, $message,
"MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nFrom: $myname<webmaster@example.com>n
X-Mailer: PHP/" . phpversion());
echo 'Membership information has been mailed to the new user\'s email address. User should check their email and follow the directions!<p><a href=adm_newuser.php>Register another new user</a>';
---------------------------------------------------------
help?