Jump to content


Photo

mail problem


  • Please log in to reply
2 replies to this topic

#1 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 06 September 2006 - 02:03 PM

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

$sent = mail($to, $subject, $message, $headers);

if($sent)
header("Location: somepage.php");

If I don't send the redirect header, the mail goes fine.

#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 06 September 2006 - 02:24 PM

Try:
if (mail($to, $subject, $message, $headers))
   header("Location: somepage.php");
else {
   // whatever code you want to execute
}

Ronald   8)
RTFM is an almost extinct art form, it should be subsidized.

#3 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 06 September 2006 - 02:41 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users