Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Mail not working properly
    text
    copied!<p>I have a very long form and the content of the form is sent via mail (HTML email).</p> <p>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.</p> <pre><code>&lt;h4&gt;&lt;span style="text-decoration:underline"&gt;OCCUPATION:&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;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.&lt;br /&gt; &lt;textarea name="personal_information_occupation"&gt; &lt;/textarea&gt;&lt;/p&gt; &lt;hr /&gt; </code></pre> <p>I went through each and every line but cannot find whats wrong with these particular lines.</p> <p>My PHP mail sends HTML email. </p> <pre><code>&lt;?php if(mail($to, $subject, $message, $headers)){ $mail_status_message = "&lt;p class='success-msg'&gt; Form Submitted Successfully. &lt;/p&gt;"; }else{ $mail_status_message = "&lt;p class='error-msg'&gt; Something went wrong. Please try again later. &lt;/p&gt;"; } ?&gt; </code></pre> <p>Basically I am getting the <code>Something went wrong. Please try again later</code> when I add the above code to the message body.</p> <p><strong>The mail headers are</strong> </p> <pre><code> $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: '.$to_name.'&lt;'.$to_email.'&gt;' . "\r\n"; $headers .= 'From: Business Name &lt;email@example.com&gt;' . "\r\n"; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload