Add ReplyTo to QueuedEmail

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 年 前
It would be a great addition to add ReplyTo email address to the QueuedEmail object and associated methods.  With many shared hosting plans (GoDaddy, WebHost4Life, etc) there are issues in getting the ContactUs page to work.  The 'From' email must be within your domain e.g. [email protected].

To work around this problem I set the 'From' email to [email protected] and include the sender's name and email address in the body of the email.

It would be great if we could make use of the 'ReplyTo' property of the System.Net.Mail.MailMessage object.  This way  the sender's email address could be used for the ReplyTo address.

Any chance of this getting added to your list :)

Thanks,
Phil
14 年 前
Thanks, Phil.
I'll create a work item for this task.
14 年 前
Using Phil's suggestion, the following code change (for version 1.30) worked for my site (YMMV) when the email server rejected sending emails when the From account was not the same as the (admin) account (i.e. emails from the Contact Us form).  

In file Libraries\Nop.Common\Messages\MessageManager.cs

In function with function signature (originally at line 787?):
public static void SendEmail(string Subject, string Body, MailAddress From, MailAddress To, List<string> bcc, List<string> cc)


Changed from:

message.From = From;

To:

if (From.Address.Equals(MessageManager.AdminEmailAddress) == false)
{
    message.ReplyTo = From;
    message.From = new MailAddress(MessageManager.AdminEmailAddress,
                   MessageManager.AdminEmailDisplayName);                
}
else
{
    message.From = From;
}


The change sets the From email address as the Reply To email address if the From address is not the admin email address.

.
14 年 前
nice work around MB

thanks, Phil
14 年 前
I'm trying to find the location to insert this code.  I can't seem to locate Libraries\Nop.Common\Messages\MessageManager.cs
Any pointers on finding this?  I have v1.3
Thanks!
14 年 前
you need to use the with SOURCE version - you will need to recompile after the change.
14 年 前
I think I understand the idea behind this work-around.

When someone uses the "Contact Us" form, the email address for "Reply To" is the source email address (the one setup in the store) and with this change the form's users email address from the form will be the "Reply To" when the email is received?
14 年 前
When someone uses the "Contact Us" form, the email address for "Reply To" is the source email address (the one setup in the store) and with this change the form's users email address from the form will be the "Reply To" when the email is received?

Not quite; did you mean "From" in the first quoted "Reply To"?. In any case, with this change, when a message is sent, it checks the From address to see if it is the Admin email address (set in Administration > Global Settings > Mail Settings). If the From address differs from the Admin address (such as in the case of a customer's email address from the "Contact Us" form), then the From address (customer's address) is set as the ReplyTo address and the Admin email address is used for the From address. When a "Contact Us" message is received by the store owner the email message's Reply-To header will have the customer's email address.

Note that the change is for version 1.30, version 1.40, by default, implements a different method to send the "Contact Us" emails (uses the Admin address as the From address and inserts the customer's email address into the message body).

.
14 年 前
So it sounds like from what your describing:


Note that the change is for version 1.30, version 1.40, by default, implements a different method to send the "Contact Us" emails (uses the Admin address as the From address and inserts the customer's email address into the message body).


My software is doing what it is supposed to, each email I receive from the form is sent 'from' the admin email address, and when I hit a "reply" button in my email software the destination is also this address (admin email address, so I'm replying it myself) if that's the case I need to reverse it so when I hit the reply button, I'm replying to the customer's email address.
14 年 前
Which version of nopCommerce are you using? If you are using version 1.40, and not the change in this topic, you should have the customer's email address in the email message body (if configuration setting: "Email.UseSystemEmailForContactUsForm" is set to true) which you would then have to manually copy to the To field when replying to the customer's email message.

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.