Thursday 26 January 2017

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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...