php crashes

the mail() function

Moderators: egami, macek, gesf

Post Reply
pugs
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Nov 02, 2017 2:00 pm

Thu Nov 02, 2017 2:24 pm

i am using php to update my database and send an email with a temp password. if i comment out the sendMail call to true it all works, i have an email and tempPassword, if i leave it in i get The page cannot be displayed because an internal server error has occurred.

Code: Select all


			if(sendMail($email,$tempPassword))
			{
				.....
			}

 function sendMail($emailSend, $tempPassword)
 {
	 $email_to = $emailSend;
	 $email_from = "info@biteboard.ca";
	 $email_bcc = "info@biteboard.ca";
	 $email_subject = "Bite Board temporary password.";
	 $email_message = "Hello " . $emailSend .
		"\n\n\n Your temporary password is " . $tempPassword .
		"\n\n Please login to the BiteBoard app and change you password using the menu." .
		"\n\n--Thank you the BiteBoard team.";
	 
	  $headers = 'From: ' . $email_from . "\r\n" .
	  'Reply-To: ' . $email_from . "\r\n" .
          'Bcc: ' . $mail_bcc . "\r\n" .
	  'X-Mailer: PHP/' . phpversion();
	  
          $reply = @mail($email_to, $email_subject, $email_message, $headers);

	  if ($reply)
	  {
		return true;
	  }
	  else
	  {
		return false;  
	  }
return false;
}


i cant seem to find my error, ive stared at the code all afternoon.

pugs
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Nov 02, 2017 2:00 pm

Thu Nov 02, 2017 2:52 pm

i figured it out, had mail instead of email in a few spots.

Post Reply