Monday, February 26, 2018

html - PHP Mail not working properly

I have a very long form and the content of the form is sent via mail (HTML email).




My PHP mail function is working perfectly for the rest of the content. But when I add the following content to the message body, the mail is not working.



OCCUPATION:



Please provide a specific and identifiable business activity and
your current position . Vague references such as"Businessman" or
"Manager" will not be accepted and will delay the incorporation
process. In the case of no employment please describe the normal
day to day activities such as "House Wife" In case of retirement
please provide details of previous occupation and your last

position.






I went through each and every line but cannot find whats wrong with these particular lines.



My PHP mail sends HTML email.





if(mail($to, $subject, $message, $headers)){
$mail_status_message = "

Form Submitted Successfully.

";
}else{
$mail_status_message = "

Something went wrong. Please try again later.

";
}

?>



Basically I am getting the Something went wrong. Please try again later when I add the above code to the message body.



The mail headers are



    $headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers

$headers .= 'To: '.$to_name.'<'.$to_email.'>' . "\r\n";
$headers .= 'From: Business Name ' . "\r\n";

No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...