Friday, 9 August 2013

How Can I Create A Simple PHP Mail Form For My Website?

How Can I Create A Simple PHP Mail Form For My Website?

I already have a form set up on my site. I created the form code myself.
I started experiencing problems with having the information e-mailed to
me, one day everything is fine and it gets e-mailed to me, the next day
the confirmation message comes up but nothing gets sent to my e-mail.
This is very critical for my line of work.
My question is: How can I create a simple php mail form that will always
work?
This is the code I have now:
$('#rSubmit').click(function(){
var data = {};
data.to = "greatlimoservice@gmail.com";
data.from = "greatlimoservice@greatlimoservice.com>";
data.subject = "New Reservation";
data.message = "New Reservation from Website \n"+
'\n First Name : '+$('#name').val()+
'\n Last Name : '+$('#lastname').val() +
'\n Company Name : '+$('#company').val() +
'\n Phone Number : '+$('#phone').val() +
'\n Street Address : '+$('#street').val() +
'\n Pick-Up City : '+$('#city').val()+
'\n Pick-Up State : '+$('#state').val() +
'\n Pick-Up Zip : '+$('#zip').val() +
'\n Date : '+$('#calendar').val()+
'\n Time : '+$('#time').val() +
'\n Time : '+$('#time2').val() +
'\n Time : '+$('#time3').val() +
'\n Airport : '+$('#airport').val() +
'\n Airline : '+$('#airline').val() +
'\n Flight # : '+$('#fnumber').val() +
'\n Stops : '+$('#hstops').val() +
'\n Stops Info : '+$('#info').val() +
'\n Passengers : '+$('#passengers').val() +
'\n Luggages : '+$('#luggages').val()+
'\n Car Seat : '+$('#seat').val()+
'\n Drop-Off Street : '+$('#dostreet').val() +
'\n Drop-Off City : '+$('#docity').val()+
'\n Drop-Off State : '+$('#dostate').val() +
'\n Drop-Off Zip : '+$('#dozip').val() +
'\n D.O Airport : '+$('#doairport').val() +
'\n D.O Airline : '+$('#doairline').val() +
'\n Flight # : '+$('#dofnumber').val() +
'\n Date : '+$('#calendar2').val()+
'\n Time : '+$('#rtime').val() +
'\n Time : '+$('#rtime2').val() +
'\n Time : '+$('#rtime3').val() +
'\n Return Street : '+$('#rtstreet').val() +
'\n Return City : '+$('#rtcity').val()+
'\n Return State : '+$('#rtstate').val() +
'\n Return Zip : '+$('#rtzip').val() +
'\n Return Airport : '+$('#rtairport').val() +
'\n Return Airline : '+$('#rtairline').val() +
'\n Return Flight # : '+$('#rtfnumber').val() +
'\n Payment Type : '+$('#payment').val() +
'\n Card Number : '+$('#creditcardno').val() +
'\n Exp. Date : '+$('#expirydate').val() +
'\n Exp. Date : '+$('#expirydate2').val()
;
Squaresend.mailto(data, function(response){
if ( response.error ) {
alert("Error: "+response.error);
} else {
$('#reserveModal').modal('hide');
alert("Congratulations! Your reservation has been made. Your
confirmation number is 3851. Please contact us if you have any
questions or comments.");
}
});
Is there any other easier/convenient way or coding I can use that will
work properly? I need to always get an e-mail once a person clicks
"Submit" on my site and this coding isn't working for me

No comments:

Post a Comment