Forum Moderators: coopster
I don't think there's any problem with my form:
<form action="/newsletter_signup.html" method="post">
<input type="text" name="email" value="Your Email Address" onfocus="value=''" />
<input type="submit" value="Subscribe!" />
</form>
In my newsletter_signup.html page (I'm parsing php as html), I have:
<?php
print "Thank you for signing up for the newsletter!<br /><br />";
print "An email has been sent to $_POST[email] to confirm your subscription.<br /><br />";
print "After you confirm your subscription, newsletters will be sent to $_POST[email].<br /><br />";
print "If you would like to unsubscribe, please send a blank email to newsletter-unsubscribe@example.com from the email address that you used to sign up.";
$recipient = "newsletter-subscribe@example.com";
$subject = " ";
$msg = " ";
$mailheaders = "From: $_POST[email]";
mail($recipient, $subject, $msg, $mailheaders);
?>
After submitting my email address, I get redirected to the newsletter_signup.html page, but I don't get an email. When I tested this last night, I could have sworn I got the email, but it's not working today. What (numerous things) am I doing wrong?
Jennifer
Yup - via .htaccess.
That much would be obvious, eh? :-)
So you say you can see the post variable all right but there's no error messages and you don't receive any email?
One other meager suggestion I have is to put a new line on the header.
$mailheaders = "From: $_POST['email']\r\n";
or
$mailheaders = "From: $_POST['email']\n";
Thank you for signing up for the newsletter!An email has been sent to email@address.com to confirm your subscription.
After you confirm your subscription, newsletters will be sent to email@address.com.
If you would like to unsubscribe, please send a blank email to newsletter-unsubscribe@example.com from the email address that you used to sign up.
no email though. When I send an email directly to newsletter-subscribe@example.com through my inbox, it works great. As for spam filters, I have my domain safe-listed.
Jennifer
Guess it's back to the basics. Replace the mail function with something like...
mail("newsletter-subscribe@example.com", "Test", "Test");
If that works then it's something you're feeding the mail function else it's something up with the mail server or php configuration.
Jennifer
<essentially said they couldn't help - jatar_k>
My question is, is it really the mailing list software that would cause a delay? I wouldn't think so, especially since I do get an immediate confirmation email when I send a request from my inbox. So, that leaves me with either there really is something wrong with my script or it has to be something with their mail configuration, right?
Jennifer
[edited by: jatar_k at 7:52 pm (utc) on May 19, 2004]
[edit reason] no email excerpts - TOS #9 [/edit]