I was setting all my mail information inside double quotes recently & it was working fine.... however, I recently purchased a domain with the text "html" in the domain & have since changed some of the text that I am using to include this new domain instead.
As soon as I did that the script still functioned, but took a good minute to process... I then enclosed each piece of "html" text inside single quotes so PHP wouldn't parse it... & bingo it worked smoothly once again.
However, then I ended up with the single quotes in the email message also.
Next thing I tried was putting everything inside single quotes, as the below code:
// Send them a validation email if no errors found
if ($error2 == 0) {
$subject = 'Activate your membership to htmlforms.com!';
$message = 'Dear ' . $username . ',
Thank you for registering @ www.htmlforms.com!
Please click the link below to activate your membership.
To activate your membership, please click here: http://www.htmlforms.com/signup/activate.php?userid=' . $username . '&code=' . $rc . '
When you have activated your membership you will be able to login with the following login information:
Username: ' . $username . '
Password: ' . $password . '
Please remember passwords are case-sensitive!
Thanks again,
Management
www.htmlforms.com';
$sender = 'From: noreply@htmlforms.com\n';
mail($email, $subject, $message, $sender);
echo "<center>\n";
echo "Congratulations! You have successfully signed up to htmlforms.com! Now all you have to do is validate your email address; to do this, click on the link in the email we just sent you.\n";
echo "<p>\n";
echo "Thank you for registering with htmlforms.com!.\n";
echo "<p>\n";
echo "<a href=\"http://www.htmlforms.com/\" class=\"plinks\">Back Home</a>";
echo "</center>\n\n";
}
This worked smoothly now.... however, I know had a new problem.. now in the email I received, it had the "\n" tagged onto the end of the From: field.
So then I tried this instead..
$sender = 'From: noreply@htmlforms.com' . "\n";
That didn't work, same problem as I initially had again... script took a LONG time to process.
I commented out the mail function & the script ran fine.....
So, anyone know exactly what the problem is here or how to fix any of the problems I'm having?
Do you think it has something to do with sendmail or a coding issue or what?
Thanks for any help!