PHP sending Email

Hello, I am just learning PHP and am making a form to submit information to our business email.

Here is the website that the page was on. http://buildersroofing.com/form.html
When you click submit it should send take you to http://buildersroofing.com/landmarkorderform.php

When I click submit order everything appears to work but I never receive an email with the info filled out.

Thanks for your help.

Here is the code for my php

[php]

<?php /*Subject and Email Variables */ $emailSubject = 'Landmark Online Order'; $webMaster = '[email protected]'; /* Gathering data variable */ $emailField = $_POST['email']; $companyField = $_POST['company']; $phoneField = $_POST['phone']; $jobnameField = $_POST['jobname']; $colorField = $_POST['color']; $shingleqtyField = $_POST['shingleqty']; $ridgeField = $_POST['ridge']; $starterField = $_POST['starter']; $vent1Field = $_POST['vent1']; $vent1qtyField = $_POST['vent1qty']; $vent2Field = $_POST['vent2']; $vent2qtyField = $_POST['vent2qty']; $icewaterField = $_POST['icewater']; $icewaterqtyField = $_POST['icewaterqty']; $feltField = $_POST['felt']; $feltqtyField = $_POST['feltqty']; $nailsField = $_POST['nailsl']; $nailqtyField = $_POST['nailqty']; $leads1Field = $_POST['leads1']; $lead1qtyField = $_POST['lead1qty']; $leads2Field = $_POST['leads2']; $lead2qtyField = $_POST['lead2qty']; $plywoodlField = $_POST['plywood']; $plyqtyField = $_POST['plyqty']; $broan1Field = $_POST['broan1']; $broun1qtyField = $_POST['broan1qty']; $broan2Field = $_POST['broan2']; $broan2qtyField = $_POST['broan2qty']; $flashingField = $_POST['flashing']; $miscField = $_POST['misc']; $body = <<<EOD


Email: $email
Company: $company
Phone Number: $phone
Job Name: $jobname
Color: $color $shingleqty
Ridge: $ridge
Starter: $starter
Vents: $vent1 $vent1qty
Vents: $vent2 $vent2qty
Ice & Water: $icewater $icewaterqty
Felt: $felt $feltqty
Nails: $nails $nailqty
Leads: $leads1 $leads1qty
Leads: $leads2 $leads2qty
Plywood: $plywood $plyqty
Broan: $broan1 $broan1qty
Broan: $broan1 $broan1qty
Flashing: $flashing
Misc: $misc
EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results Rendered*/ $theResults = <<<EOD Order Submitted Thanks you for submitting your order! EOD; echo "$theResults"; ?>[/php]
hi, i have checked your code and found that you are passing wrong variables to $body and $headers.

[php]

##Use below code for $body and $headers##
$body = <<<EOD




Email: $emailField

Company: $companyField

Phone Number: $phoneField

Job Name: $jobnameField

Color: $colorField $shingleqtyField

Ridge: $ridgeField

Starter: $starterField

Vents: $vent1Field $vent1qtyField

Vents: $vent2Field $vent2qtyField

Ice & Water: $icewaterField $icewaterqtyField

Felt: $feltField $feltqtyField

Nails: $nailsField $nailqtyField

Leads: $leads1Field $lead1qtyField

Leads: $leads2Field $lead2qtyField

Plywood: $plywoodlField $plyqtyField

Broan: $broan1Field $broun1qtyField

Broan: $broan2Field $broan2qtyField

Flashing: $flashingField

Misc: $miscField

EOD;

$headers = “From: $emailField\r\n”;
$headers .= “Content-type: text/html\r\n”;
[/php]

I hope this will helpful for you.
reply your feedback.
SR

Thanks SR
I made the change but still I’m getting no email.

Update!
i added a $ in front of " $success = mail($webMaster" and am now getting a email.
However the info I put into the form is not being sent.
I fill out the forum completely and the email returns:

Email:
Company:
Phone Number:
Job Name:
Color:
Ridge:
Starter:
Vents:
Vents:
Ice & Water:
Felt:
Nails:
Leads:
Leads:
Plywood:
Broan:
Broan:
Flashing:
Misc:

it was already there in the code you have in the first post.

hello richei, run below code i hope it will work perfectly for you.

1.) Save below code as userdata.html
[php]
#you can replace form field with your required field. Currently i am using some dummy fields.

Email:

Subject:

Clickbank ID:

Location:

Domain Name:


[/php]

2.) Save below code as mailscript.php

[php]

<? //change this to your email. $to = "[email protected]"; // put your email id here $from = $_POST['email']; // user email id $subject = $_POST['subject']; // your subject line //begin of HTML message $message = ' I am reciving HTML email......
Contact Form detail Fillup by User
Sender Email '.$_POST['email'].'
Clickbank ID '.$_POST['cbid'].'
Location '.$_POST['location'].'
Domain Name '.$_POST['domain'].'
Thanks Sanjay!
'; //end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; // now lets send the email. mail($to, $subject, $message, $headers); echo "Message has been sent....!"; ?>

[/php]

I hope this will works for you…
Reply your feedback.
SR

I don’t need it, i make my own support scripts :slight_smile:

you need to look up the proper headers to use with html, with just the basic set, the email is likely to be rejected by server-side spam filters.

Sponsor our Newsletter | Privacy Policy | Terms of Service