blastbum Posted February 26, 2009 Share Posted February 26, 2009 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 Link to comment https://forums.phpfreaks.com/topic/146967-solved-need-email-address-to-appear-in-from-field-on-email-from-contact-page/ Share on other sites More sharing options...
fry2010 Posted February 26, 2009 Share Posted February 26, 2009 When the user sends the form you need to store the email they provide and include it in your last variable $cabeceras. Then change it to from:. $cabeceras = 'From:' .$_POST['email']; Link to comment https://forums.phpfreaks.com/topic/146967-solved-need-email-address-to-appear-in-from-field-on-email-from-contact-page/#findComment-771513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.