View Full Version : PHP Mail sample
chako.org
04-09-2012, 05:12 AM
HI there everyone,
I'm wondering if anyone has an example of PHP Mail webpage code that they could share with me. I need to get 'Required fields' implemented on my web pages so I am getting away from Blue Mail. I've tried to implement a PHP Mail web page, but nothing appears to happen, either in the way of displaying the form, or even submitting the e-mail.
Thanks! - Eric -
triple_h
04-09-2012, 01:46 PM
heres an example of one that im using...
<?php
$ForwardTo="larry @ elarroyoarlington .com, dean @ elarroyoarlington .com, deancombs @ gmail .com, bentace @ sbcglobal .net, paul @ elarroyoarlington .com";
$email=$_REQUEST['EmailAddr'];
$name=$_REQUEST["Name"];
$phone=$_REQUEST["Phone"];
$comment=$_REQUEST["Comments"];
$details='Name: '.$name."\n"
.'Phone: '.$phone."\n"
.'Comments: '.$comment."\n";
mail($ForwardTo,"El Arroyo Customer Contact",$details,"From:$email");
header("Location: thankyou.html");
?>
and in my over all head to make this work....
function verify(fm) {
if (fm.Name.value == "") {
alert("Please enter your name");
fm.Name.focus();
return false;
}
if (fm.EmailAddr.value == "") {
alert("Please enter your e-mail address");
fm.EmailAddr.focus();
return false;
}
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fm.EmailAddr.value))) {
alert("Your e-mail address does not appear to be valid. Please re-enter.");
return (false);
fm.EmailAddr.focus();
}
return (true);
}
check it out...
http: // elarroyoarlington .com/contactus.html
Justin
04-10-2012, 08:10 PM
The best thing is to go for a custom web form. Check this PHP contact form out with AJAX and Captcha validation: http://www.devzeal.com/contact-us/
If you like it, I can sell a copy to you.
chako.org
04-15-2012, 08:34 AM
Bob,
Thanks so much for the great information. It is exactly what I needed to know. I'm new to developing web pages so it took me a while to figure out that I needed to create a 'sendmail.php' object, but once I figured that out, I was good to go.
Thanks again so much! - Eric -
zhijuefe
08-01-2012, 03:59 AM
you can upload a yahei scripts, and have a try. if you have more qustion ,you can go to http: // www. bluehostbbs .com bbs ask.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.