Jump to content

Recommended Posts

Posted

Hi All,

I'm fairly new to this, and trying to get a action.php to process a form and send an email to the user.  

//$EmailAddress is set by a form input
//$sendFrom is set by the refering form
//$body is build by form inputs and other information
//$subject is build by refering page
$headers = "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: " . $sendFrom ."\n";
$headers .= "Reply-to:" . $sendFrom ."\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-Mailer: PHP4\n";
if (mail($EmailAddress, $subject, $body, $headers)){
print "<a href='login.php'>Login</a><br>";
	 print "Your password was emailed to you. Please check your email within a few minutes.";

 }
 else{
	 print "Your password could not be emailed.. Please contact your system admin or try again.";
	 exit;
 }

With the if statement in, all it does is spin with no email sent.  When I comment out the if block, the form works.  

Any suggestions on how to fix this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...