Jump to content

Recommended Posts

I have built a web form that send to my email from another email in my system, mail goes through just fine, however, the From header in the received email shows my server address instead of the proper from address. Here is the script.

 

ini_set("sendmail_from","xxx@xxxxxxxxx.net");  
 
 
 
 
$subject = 'Device Purchase Alert: '.$_POST['manufacturer'].' '.$_POST['model'];
$message = 'Hello, '.$_POST['name'].' has received a '.$_POST['manufacturer'].' '.$_POST['model'].' for '.$_POST['carrier'].' in '.$_POST['condition'].' condition. This item was a '.$_POST['type'].' for the amount of $'.$_POST['amount'].'. The ESN/MEID of this device is '.$_POST['meid'].'.<br><br>Comments: '.$_POST['comments'].'<br><hr><br><i>This email is intended for employees and management of Gomo Wireless. If you are not one of these people, please delete this email immediately. Thank you</hr></i>';
 
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Purchasing' . "\r\n";
$headers .= 'From: xxx@xxxxxxxxx.net' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
 
 
mail("xxxxxxx@xxxxxxxxx.net", $subject, $message, $headers, "-f xxxxxxx@xxxxxxxxx.net"); 
 
  


 

not sure what I am doing wrong.
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.