This might be the wrong place to post this issue, but I had to start somewhere. If this issue should go in the PHPMailer issue queue, I'm fine with that too.

I'm using Webform 6.x-3.11 along with PHPMailer and a Google Apps account.

In Webform I have an E-mail setup to come to me where the "E-mail from address:" is set to what the user types in. Same for the "E-mail from name:".

It seems as though PHPMailer overrides the "E-mail from address:" and uses the account address that it is authenticating with. This is understandable and not all bad.

I have the PHPMailer Advanced SMTP settings for '"From" name:' set, along with the checkbox for 'Always set "Reply-To" address' checked.

A Reply-To address shows up exactly as I want it in the e-mail to me, with the From Name set to the user submitted value and the From E-mail value set to the user entered value.

The problem is that the "From Name" portion of the From header does not get set to the value in the PHPMailer settings, but rather uses the same user submitted "From Name" value that Webform gathered.

I'd like it to behave like the following:

From: "PHPMailer Name" < PHPMailer E-mail >
Reply-To: "Webform User Name" < Webform User E-mail >

but right now the e-mails show up like:

From: "Webform User Name" < PHPMailer E-mail >
Reply-To: "Webform User Name" < Webform User E-mail >

I'm not sure which module is taking control of any of this. If this issue needs to be and can be moved, that'd be fine, otherwise I can repost it elsewhere.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MPankau’s picture

anyone?

quicksketch’s picture

Project: Webform » PHPMailer
Version: 6.x-3.11 » 6.x-3.x-dev

I'm going to move this over to the PHPMailer queue because it's the one doing the modification of the mails. It's also likely that the maintainer over there will be familiar with Webform, as opposed to myself (the Webform maintainer) who doesn't know the first thing about what PHPMailer is used for.

TommyK’s picture

Thanks, I appreciate you moving this issue rather than me reposting it.

bendiy’s picture

Category: support » feature
Status: Active » Needs review
FileSize
2.09 KB
2.09 KB

I've ran into this problem and have created a patch that should resolve it. When your site is setup with a Site information E-mail address like "webmaster@example.com", setting From name to "The example.com Team" is nice. However, when emails go out with the from address of one of your normal users, "bob@gmail.com", the email will arrive like "The example.com Team bob@gmail.com". Obviously, Bob is not part of the "The example.com Team" and this should not be setup this way.

Emails like this happen on the "Contact Us" form, Web Forms, user forum posts, etc.

The attached patch will add an admin setting checkbox to PHPmailer that when checked, will compare the from email's domain address to the one you have set in Site information E-mail address. If they share the same domain, the From name will be, "The example.com Team". If they do not share the same domain, the email will simply go out with no From name.

This could easily be expanded from just a checkbox to a text area where you could add each email address that was permitted to send email as "The example.com Team".

oadaeh’s picture

Status: Needs review » Closed (won't fix)

This issue is being closed due to Drupal 6 being at the end of its life. If you feel this is still a valid issue for the Drupal 7 compatible branch of this module, feel free to re-open this issue and provide updated information.

hkovacs’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Category: Feature request » Bug report
Status: Closed (won't fix) » Needs work

@oadaeh

Hi, I have turned this back on and changed the details as the "From" name still isn't working even after applying d7 patch in #5.

Whether I set the field "From" name or leave it empty, I dont get either the custom "From" name or the default site name. I always get just the reply to email address.

Thanks.

hkovacs’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta1

changed version.

oadaeh’s picture

Assigned: Unassigned » oadaeh
Status: Needs work » Active

I am working on this, but it might take me a bit of time, because I want to attempt to account for all situations at one time, rather than keep revisiting the issue every time someone wants something different, and the attached patches do not do that.

oadaeh’s picture

Version: 7.x-3.0-beta1 » 7.x-3.x-dev
hkovacs’s picture

Great to hear!

Perhaps we can brainstorm here what the scenarios are and if you point me to where you are looking in the module, then I can see what I can do to help.

Thanks.