Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default Changing FROM ADDRESS in emails

    Hello,

    Hopefully this is a problem with an easy solution, but I've been searching the forums with no luck. Right now, when a customer sends me an email using the Zen Cart default Contact Us form, Zen Cart sends me that email using my own email address in the FROM field of the email. I'd like to have my customer's email address in that FROM field (to make it easier to reply to her and also to integrate better with osTicket.)

    Is there a way to do this?

    Thank you very much for your help in advance!

    Alex

  2. #2
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default Re: Changing FROM ADDRESS in emails

    I just took a look at my functions_email.php file where I found this code

    Code:
          // set the reply-to address.  If none set yet, then use Store's default email name/address.
          // If sending from contact-us or tell-a-friend page, use the supplied info
          $email_reply_to_address = ($email_reply_to_address) ? $email_reply_to_address : (in_array($module, array('contact_us',  'tell_a_friend')) ? $from_email_address : EMAIL_FROM);
          $email_reply_to_name    = ($email_reply_to_name)    ? $email_reply_to_name    : (in_array($module, array('contact_us',  'tell_a_friend')) ? $from_email_name    : STORE_NAME);
          $mail->AddReplyTo($email_reply_to_address, $email_reply_to_name);
    Does this mean that my contact_us form should be using the customer's email address? Or do I have to customize this to make that happen?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing FROM ADDRESS in emails

    Zen Cart will set the "ReplyTo" email address to the sender's (potential customer's) address. If you click "Reply", the sender's address should show in the To field automatically.

    It uses your store's address as the "from" address, in order to minimize the likelihood of the email getting caught in a spam filter because of an attempt to spoof, or pretend, to be some other address.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default Re: Changing FROM ADDRESS in emails

    Dr. Byte, thank you for your response.

    I can see the logic there, but in order to it to integrate seamlessly with my osTicket set up, I would need to have the actual FROM: address be the customer's email address. (As it is now, osTicket is sending out it's autoresponses with the Support Ticket number to my store's email address...)

    Is there a way for me to change this so that the FROM address is actually the customer's email?

    Thank you very much for your help!

    Alex
    Zen Cart 1.3.8a - Database Patch Level: 1.3.8 - PHP Version 5.2.6

  5. #5
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default Re: Changing FROM ADDRESS in emails

    So, I'm still trying with this. I tried to add this block of code

    Code:
                $from_email_address = ($from_email_address) ? $from_email_address : (in_array($module, array('contact_us',  'tell_a_friend')) ? $from_email_address : EMAIL_FROM);
    at line 223 of functions_email.php.

    And moved this block of code:

    Code:
                $mail->From     = $from_email_address;
    right under it.

    But nothing changed. Does anyone have an ideas as to how to make this work?
    Zen Cart 1.3.8a - Database Patch Level: 1.3.8 - PHP Version 5.2.6

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing FROM ADDRESS in emails

    Try setting Admin->Configuration->Email options->Emails must send from known domain ... to No ... and pray that your server doesn't require that setting to be on.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default Re: Changing FROM ADDRESS in emails

    Well, heck, that seems to have done the trick! It's now working! Thank you, DrByte!

    So... about this prayer thing... do I need to worry that I'm violating my webhost's Terms of Service by doing this? Or was I just praying that it would work?
    Zen Cart 1.3.8a - Database Patch Level: 1.3.8 - PHP Version 5.2.6

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing FROM ADDRESS in emails

    That setting is normally intended to help minimize the risk of your outbound emails being seen as spam and thus getting dumped into a blackhole instead of ever getting delivered.
    In your case, time will tell.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Sep 2008
    Posts
    397
    Plugin Contributions
    0

    Default Re: Changing FROM ADDRESS in emails

    Quote Originally Posted by DrByte View Post
    Try setting Admin->Configuration->Email options->Emails must send from known domain ... to No ... and pray that your server doesn't require that setting to be on.
    Thank you DrByte!

 

 

Similar Threads

  1. STATE missing from address in emails
    By ianhg in forum Managing Customers and Orders
    Replies: 0
    Last Post: 7 Feb 2011, 11:38 PM
  2. email address - sent from, multiple emails
    By illusionest in forum Basic Configuration
    Replies: 2
    Last Post: 10 Nov 2010, 02:18 AM
  3. Replies: 0
    Last Post: 27 Aug 2008, 01:35 PM
  4. Changing Database from 'localhost' to a IP Address.
    By Jump Network in forum Basic Configuration
    Replies: 5
    Last Post: 25 Aug 2007, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg