designfarmer Posted October 18, 2012 Share Posted October 18, 2012 I am having a big issue pertaining to the From: field when my form data is sent to clients email. When my clients form is filled out and sent to their email address it is currently showing up as webmaster@... in the From: column of their inbox. I need it to show the customers (person filling out the form) name or email in the From: section in their inbox instead of webmaster@... Also, nn automatic "order received" message is sent to the customer once an order is placed. When this message is sent it is also showing up as From: webmaster@... In this instance I need it to show my clients name or email in the From: field in the customers inbox rather than the webmaster@... Here is my current code. /* Mail Function */ $to = 'info@indeygo.com'; $from = 'From: You <info@indeygo.com>'; $subject = 'Indeygo Customer Order'; // 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 .= 'To: InDeyGo <info@indeygo.com>' . "\r\n"; $headers .= 'From: ' . $from . "\r\n"; mail($to, $subject, $message, $headers); mail($email, "Thank you for your Order", "You will receive confirmation within 24 hours that your order has been received. If you don't hear from us, please call 1-877-463-3946 to confirm we received your order.\n\nThis is an automatically generated message, please do not reply to it."); header("Location: ../thank-you-order.php"); Any help would be greatly appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/269638-setting-up-from-when-sending-form-data-to-an-email/ Share on other sites More sharing options...
Christian F. Posted October 18, 2012 Share Posted October 18, 2012 You don't want to do this, as this will almost without fail cause the e-mail to end up in the spam-box. If it's not blocked outright. Send it from "orders@your.domain" or "no-reply@....", or whatever else, just as long as it's sending from the same domain that the site uses. Quote Link to comment https://forums.phpfreaks.com/topic/269638-setting-up-from-when-sending-form-data-to-an-email/#findComment-1386131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.