Jump to content

PHP Mail Form Help


TheSaint97

Recommended Posts

Ok for the most part this script gets the job done. However, for some strange reason when I receive the email from them, instead of having their email address in the "From:" it has some weird address like: $email@p3nlh023.shr.prod.phx3.secureserver.net

 

Now in the body of the email it will list their correct address. Here is part of the script I'm using...

 

<?php

 

/* Subject and Email Variables */

 

$to = 'myemail@mydomainname.com';

$subject = 'Form Submission';

 

/* Data Variables */

 

$name = $_POST['name'];

$phone = $_POST['phone'];

$address = $_POST['address'];

$name = $_POST['name'];

$phone = $_POST['phone'];

$address = $_POST['address'];

$city = $_POST['city'];

$state = $_POST['state'];

$email = $_POST['email'];

$type = $_POST['type'];

$reason = $_POST['reason'];

$value = $_POST['value'];

$owed = $_POST['owed'];

$repairs = $_POST['repairs'];

$agent = $_POST['agent'];

$offer = $_POST['offer'];

 

/* What Will Appear in Body of Email */

 

$body = <<<EOD

<br><hr><br>

Name = $name <br>

Phone = $phone <br>

Address = $address <br>

City = $city <br>

State = $state <br>

Email = $email <br>

Type = $type <br>

Reason = $reason <br>

Value = $value <br>

Owed = $owed <br>

Repairs = $repairs <br>

Agent = $agent <br>

Offer = $offer <br>

EOD;

 

/* To send HTML mail, the Content-type header must be set */

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

/* Additional headers */

$headers .= 'From: $email' . "\r\n";

$headers .= 'Cc: myalternateemail@whatever.com' . "\r\n";

$headers .= 'Bcc: myalternateemail@whatever.com' . "\r\n";

 

/* Mail it */

mail($to, $subject, $body, $headers);

 

Also, once in awhile I will get an email where the body is completely empty. It will still list

 

Name =

Phone =

Address =

City =

State =

Email =

Type =

Reason =

Value =

Owed =

Repairs =

Agent =

Offer =

 

It just doesn't show the answer they gave. I'm a beginner so any help would be greatly appreciated. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.