Jump to content

[SOLVED] Need Email Address To Appear In "From" Field On Email From Contact Page


blastbum

Recommended Posts

Hi,

 

My client has told me that the emails that are getting sent to them from the contact page (http://www.nobleboatsinternational.com/contactus.php), doesn’t have the senders email address in the “From” field. As a result, they can’t hit reply with the senders email address automatically appearing in the “To” field of the new email. At the moment, the “From” field has this:

 

From: Nobody [mailto:[email protected]] On Behalf Of enquiries

 

The code where this issue is to be resolved is featured below:

 

// Multiple recipients
$para = '[email protected]';

// asunto
$asunto = 'Contact from Contact Us form from Noble Boats International';

// mensaje
$mensaje = '
<html>
<head>
  <title>Contact form</title>
</head>
<body>
  <table>
    <tr>
      <th width="200">First Name</th><td>'.$_POST["first_name"].'</td>
    </tr>
    <tr>
      <th>Last Name</th><td>'.$_POST["last_name"].'</td>
    </tr>
    <tr>
      <th>Email</th><td>'.$_POST["email"].'</td>
    </tr>
    <tr>
      <th>Country</th><td>'.$_POST["country"].'</td>
    </tr>
    <tr>
      <th>ZIP</th><td>'.$_POST["zip"].'</td>
    </tr>
    <tr>
      <th>Enquiry</th><td>'.$_POST["enquiry"].'</td>
    </tr>
  </table>
</body>
</html>
';

// Para enviar correo HTML, la cabecera Content-type debe definirse
$cabeceras  = 'MIME-Version: 1.0' . "\r\n";
$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Cabeceras adicionales
$cabeceras .= 'To: enquiries <[email protected]>' . "\r\n";
$cabeceras .= 'To: enquiries <[email protected]>' . "\r\n";

// Enviarlo
if(mail($para, $asunto, $mensaje, $cabeceras)){

 

To be more specific, the line of code where this issue can be fixed is on the second line featured below:

 

$cabeceras .= 'To: enquiries <[email protected]>' . "\r\n";
$cabeceras .= 'To: enquiries <[email protected]>' . "\r\n";

 

Can anyone help me fix this? I would really appreciate it, if you could help me out ASAP. Thank you.

 

Many thanks,

 

Dan

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.