Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing FROM ADDRESS in emails

Changing FROM ADDRESS in emails

Locked

Views: 1,349

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
14 Nov 2008, 9:05 PM
#1
alexwoolfson avatar

alexwoolfson

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

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

15 Nov 2008, 12:38 AM
#2
alexwoolfson avatar

alexwoolfson

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Changing FROM ADDRESS in emails

I just took a look at my functions_email.php file where I found this 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?

15 Nov 2008, 8:12 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

15 Nov 2008, 8:19 AM
#4
alexwoolfson avatar

alexwoolfson

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Changing FROM ADDRESS in emails

Dr. Byte, thank you for your response. :smile:

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

16 Nov 2008, 2:39 AM
#5
alexwoolfson avatar

alexwoolfson

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Changing FROM ADDRESS in emails

So, I'm still trying with this. I tried to add this block of 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:

            $mail->From     = $from_email_address;

right under it.

But nothing changed. Does anyone have an ideas as to how to make this work?

16 Nov 2008, 3:59 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

16 Nov 2008, 6:51 AM
#7
alexwoolfson avatar

alexwoolfson

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Changing FROM ADDRESS in emails

:clap: 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?

16 Nov 2008, 2:19 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

26 Dec 2010, 10:30 PM
#9
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: Changing FROM ADDRESS in emails

DrByte:

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!