Hi.
In the documentation of this module says:
Note however, that Google automatically rewrites the "from" line of any e-mail
you send via their SMTP gateway to your Google Mail address.
It is ok. I understand it. But this is a problem for "Contact" Module. When a user send an email from a contact form, gmail overwrite the sender and if I check my mailbox and click on "reply" I will reply to my @gmail account and not to the real sender of the message.
Maybe this module can set the "Reply-to" header to the original sender of the message. Or maybe it is already implemented and I'm doing something wrong. Or maybe it is simply not possible....
Anyway thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#11 | 607204-reply-to.patch | 5.08 KB | smk-ka |
#5 | 607204-reply-to.patch | 2.8 KB | smk-ka |
#1 | phpmailer-gmail-replyto.patch | 699 bytes | dagmar |
Comments
Comment #1
dagmarWith this patch I have solved my problem. Now when I click on Reply from my inbox I'm reply to the real sender of the message.
Comment #2
sshvetsov CreditAttribution: sshvetsov commentedI agree with dagmar, it is a problem when contact form is used with Google's SMTP server.
My hosting provider is forcing me to use SMTP for all outgoing emails, and Google rewrites the "From" header, so I cannot reply to emails sent to me via contact form.
I'll tried your patch, dagmar, and it does achieve the desired result - ability to click "Reply" and actually send email to original sender.
Comment #3
smk-ka CreditAttribution: smk-ka commentedI have to disagree here: the PHPMailer module is a dumb library, it takes whatever it is fed and doesn't make any custom alterations specific to a certain configuration.
Luckily, Drupal provides a way to do the required alterations: what you want is a custom hook_mail_alter() implementation, something along the lines of
(Untested.) Put that code into custom.module, add an .info file and you have the desired Reply-To header in the e-mail.
However, the module didn't actually make use of the Reply-To headers until now, thus you need a decent development snapshot for this technique to work.
Comment #4
dagmarSorry Stefan, I have to reopen this issue again.
Let me explain better why this feature should be included into PHPMailer module.
First, this patch doesn't modify phpmailer.class.inc, it modified drupal.phpmailer.inc, so it can be implemented without hack phpmailer library.
Secondly, there are probably 1000 sites using PHPMailer to send emails from their sites. Probably a lot of them doesn't know that they are replying messages to an incorrect email address. I'm using Drupal for two years and internet for about 10, and discovered this after 3 months of use PHPMailer. Too late.
If you prefer to use a phpmailer_mail_alter() to include this feature as a conditional option, please let me know, and I will write the patch. However, if you insist in your position to keep this option out of PHP Mailer, please, at least add a small note into README.txt preventing users about this behavior.
Grettings
Mariano
Comment #5
smk-ka CreditAttribution: smk-ka commentedOk, thought about this again and it seems safe to set Reply-To to the From address if, and only if, the message doesn't contain an explicitly set Reply-To header, otherwise we would possibly add a wrong reply-to address. Since drupal_mail() doesn't set this header, PHPMailer may use the From address unless it has been set by another module. Please test the attached patch.
Comment #6
smk-ka CreditAttribution: smk-ka commentedE-mails sent with a Reply-To look ugly in e-mail programs. This should really be turned into an advanced option with an explanation when to enable.
Comment #7
kthullI installed the latest dev to try to deal with gmail changing the from address and after running update.php and testing the form, I get this error:
Can not call constructor in /[path]/phpmailer/includes/phpmailer.class.inc on line 26
Comment #8
smk-ka CreditAttribution: smk-ka commented@kthull
Which version of the PHPMailer library did you download? It is possible that the latest changes regarding exception handling require one of the 5.0.x versions (5.1 hasn't been tested yet, but should work, too).
Comment #9
kthullI used 5.0.2. I can no longer recall how many different things I tried, but I know I had to abandon gmail altogether. I'm using PHPMailer with a non-gmail smtp server and working just fine now.
Thanks!
Comment #11
smk-ka CreditAttribution: smk-ka commentedOk, I've added an option to the settings page and updated the Google Mail instructions accordingly. Committed the attached patch to all branches.