When I enter data in the web page form and click the send button I receive the "mailed successfully" message, but nothing is showing up in by email inbox. Can anyone tell me where my error is in the following code?
HTML:
<aside class="widget widget_custom_contact_form_entries">
<h6 class="widgettitle">Quick Message</h6>
<div class="cmsms-form-builder">
<di
v class="widgetinfo">Thank you! <br /> Your message has been sent successfully. </div>
JQUERY:
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#form_contact_form_widget_001').validationEngine('init');
jQuery('#form_contact_form_widget_001a#contact_form_widget_001_wformsend').click(function () {var form_builder_url = jQuery('#contact_form_widget_001_wurl').val();
jQuery('#form_contact_form_widget_001 .loading').animate( {opacity : 1} , 250);
if
(jQuery('#form_contact_form_widget_001').validationEngine('validate')) { jQuery.post(form_builder_url, {field_002 : jQuery('#field_002').valfield_003 : jQuery('#field_003').val(), field_004 : jQuery('#field_004').val(), formname : 'contact_form_widget_001', formtype : 'widget'}, function () { jQuery('#form_contact_form_widget_001 .loading').animate( { opacity : 0 }, 250);
document.getElementById('form_contact_form_widget_001').reset();
jQuery('#form_contact_form_widget_001').parent().find('.widgetinfo').hide(); jQuery('#form_contact_form_widget_001').parent().find('.widgetinfo').fadeIn('fast');
jQuery('html, body').animate( { scrollTop : (jQuery('#form_contact_form_widget_001').offset().top - 100) }, 'slow');
jQuery('#form_contact_form_widget_001').parent().find('.widgetinfo').delay(5000)
.fadeOut(1000);
} );
return false; }
else {
jQuery('#form_contact_form_widget_001 .loading').animate( { opacity : 0 }, 250);
return false;
}
} );
} );
</script>
HTML:
<form action="mailto:scottmriley@yahoo.com" method="post" id="form_contact_form_widget_001">
<div class="form_info cmsms_input">
<label for="field_002">Your Name<span class="color_3">*</span></label>
<input type="text" name="wname" id="field_002" size="22" tabindex="11" class="validate[required,minSize[3],maxSize[100],custom[onlyLetterSp]]" />
</div>
<div class="form_info cmsms_input">
<label for="field_003">Email<span class="color_3">*</span></label>
<input type="text" name="wemail" id="field_003" size="22" tabindex="12" class="validate[required,custom[email]]" />
</div>
<div class="form_info cmsms_textarea">
<label for="field_004">Message<span class="color_3"> *</span></label>
<textarea name="wmessage" id="field_004" cols="28" rows="6" tabindex="13" class="validate[required,minSize[3]]"></textarea>
</div>
<div class="loading"></div>
<div>
<input type="hidden" name="contact_form_widget_001_wurl" id="contact_form_widget_001_wurl" value="php/sendmail.php" />
</div><!-- Here you need to set the path to the sendmail file -->
<div>
<a href="php/sendmail.php" id="contact_form_widget_001_wformsend" class="button" tabindex="14"><span>Send Message</span></a>
<input type="reset" class="button" value="Reset" />
</div>
</form>
</aside>
PHP:
?php
if (isset($_REQUEST['formtype']) && $_REQUEST['formtype'] == 'form') {
if (isset($_REQUEST['formname'])) {
}
} elseif (isset($_REQUEST['formtype']) && $_REQUEST['formtype'] == 'widget') {
if (isset($_REQUEST['formname'])) {
$formname = $_REQUEST['formname'];
$field_002 = $_REQUEST['field_002'];
$field_003 = $_REQUEST['field_003'];
$field_004 = $_REQUEST['field_004'];
$mailAddress = 'scottmriley@yahoo.com';
$subject = 'Subject';
$msg = "Message $field_002
$field_003
$field_004";
$headers = "MIME-Version: 1.0
Content-type: text/plain; charset=utf-8
From: " . $_REQUEST[$result->slug] . "
Reply-To: " . $_REQUEST[$result->slug] . "
X-Mailer: PHP/" . phpversion();
mail($mailAddress, $subject, $msg, $headers);
}
} elseif (isset($_REQUEST['formtype']) && $_REQUEST['formtype'] == 'contactf') {
if (isset($_REQUEST['formname'])) {
$formname = $_REQUEST['formname'];
$contact_name = $_REQUEST['contact_name'];
$contact_email = $_REQUEST['contact_email'];
$contact_url = $_REQUEST['contact_url'];
$contact_subject = $_REQUEST['contact_subject'];
$contact_message = $_REQUEST['contact_message'];
$mailAddress = 'scottmriley@yahoo.com';
$subject = 'Subject';
$msg = "$contact_name
$contact_email
$contact_url
$contact_subject
$contact_message";
$headers = "MIME-Version: 1.0
Content-type: text/plain; charset=utf-8
From: " . $_REQUEST[$result->slug] . "
Reply-To: " . $_REQUEST[$result->slug] . "
X-Mailer: PHP/" . phpversion();
mail($mailAddress, $subject, $msg, $headers);
}
}
?>