jcombs_31 Posted September 6, 2006 Share Posted September 6, 2006 I don't really have a problem sending a simple text email, the problem is that I'm trying to redirect after the mail is sent to a notification page. It seems that when I redirect, the mail doesn't get sent. I tried setting a variable to the mail function, and then check for the variable to redirect, like this[code]$sent = mail($to, $subject, $message, $headers);if($sent)header("Location: somepage.php");[/code]If I don't send the redirect header, the mail goes fine. Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 6, 2006 Share Posted September 6, 2006 Try:[code]if (mail($to, $subject, $message, $headers)) header("Location: somepage.php");else { // whatever code you want to execute}[/code]Ronald 8) Quote Link to comment Share on other sites More sharing options...
jcombs_31 Posted September 6, 2006 Author Share Posted September 6, 2006 I tried it that way as well, which is why I tried checking for the variable. It's like the page redirects before the mail function gets a chance to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.