Note that there are some explanatory texts on larger screens.

plurals
  1. POcontact form not sending to email cakephp
    primarykey
    data
    text
    <p><strong>i'm new in php..i would like to sent contact form to my gmail account.. everything just going fine whrn i click the submit button,but my problem is this form not sending me the email..</strong></p> <p>this is my html code</p> <pre><code> &lt;form action="kontact-sent" onSubmit="return validate_form(this)" method="post"&gt; &lt;table width="415" border="0" cellspacing="1" cellpadding="5" class="t1"&gt; &lt;tr&gt; &lt;td align="left" valign="top" bgcolor="#efefef"&gt;First name:&lt;br /&gt;&lt;input name="FirstName" type="text" id="FirstName" style="width:300px;" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td align="left" valign="top" bgcolor="#efefef"&gt;Email address&lt;br /&gt;&lt;input type="text" name="EmailAddress" id="EmailAddress" style="width:300px;" /&gt; &lt;input name="Email_Confirmation" class="Email_Confirmation2"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td align="left" valign="top" bgcolor="#efefef"&gt;Message&lt;br /&gt;&lt;textarea name="Inquiry" id="Inquiry" style="width:300px; height:100px;"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td align="left" valign="top" bgcolor="#efefef"&gt;&lt;input type="submit" value="Submit"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; function validate_EmailAddress(field,alerttxt){ with (field) { apos=value.indexOf("@"); dotpos=value.lastIndexOf("."); if (apos&lt;1||dotpos-apos&lt;2) {alert(alerttxt);return false;} else {return true;} } } function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt);return false; } else { return true; } } } function validate_form(thisform) { with (thisform) { if (validate_required(FirstName,"Please enter your First Name.")==false) {FirstName.focus();return false;} if (validate_EmailAddress(EmailAddress,"Please enter a valid Email Address.")==false) {EmailAddress.focus();return false;} if (validate_Inquiry(Inquiry,"Please enter your Inquiry.")==false) {Inquiry.focus();return false;} } } </code></pre> <p>this is my .php</p> <pre><code>&lt;?php // if the Email_Confirmation field is empty if(isset($_POST['Email_Confirmation']) &amp;&amp; $_POST['Email_Confirmation'] == ''){ // put your email address here scott.langley.ngfa@statefarm.com, slangleys@yahoo.com $youremail = 'afiqrashid91@gmail.com'; // prepare a "pretty" version of the message $body .= "Thank You for contacting us! We will get back with you soon."; $body .= "\r\n"; $body .= "\r\n"; foreach ($_POST as $Field=&gt;$Value) { $body .= "$Field: $Value\r\n"; $body .= "\r\n"; } $CCUser = $_POST['EmailAddress']; // Use the submitters email if they supplied one // (and it isn't trying to hack your form). // Otherwise send from your email address. if( $_POST['EmailAddress'] &amp;&amp; !preg_match( "/[\r\n]/", $_POST['EmailAddress']) ) { $headers = "From: $_POST[EmailAddress]"; } else { $headers = "From: $youremail"; } // finally, send the message mail($youremail, 'Form request', $body, $headers, $CCUser ); } // otherwise, let the spammer think that they got their message through ?&gt; Thank You for contacting us! We will get back with you soon. </code></pre> <p>i hope that anyone can help me..thanks in advance..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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