Jump to content

Setting Up "from:" When Sending Form Data To An Email.


designfarmer

Recommended Posts


  •  

     

     

    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 */


    $from = 'From: You <[email protected]>';

     

     

    $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 <[email protected]>' . "\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.


     

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 "[email protected]" or "no-reply@....", or whatever else, just as long as it's sending from the same domain that the site uses.

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.