I am able to send mail.
I have smtp-6.x-1.0-beta5 with PHPMailer 5.0 on my system.

In configuration I set E-mail from name: SMTP Mail

However at receiving end I am getting only SMTP as from name.

Please help

Comments

akalata’s picture

Are you using Webform? I've begun to notice the same thing where Webform (both 6.x-2.x and 6.x-3.x) submission "from" is cut off, but regular Drupal actions (update notices, SMTP tests) are sending correctly with the full name.

Also, please note that the project page states that PHPMailer versions higher than 2.2.1 are not supported. I'm not sure that this is the cause of the problem, as my sites are running different versions from 2.3 to 5.1, so I'm going to get that fixed.

BrockBoland’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new886 bytes

Are you using Simplenews? I'm having the same problem, and wondering if Simplenews is formatting the From address before sending. In smtp_drupal_mail_wrapper(), $message['from'] comes in as:

"Information Mailing" <info@example.com>

I modified the regex in the preg_replace() to use "\t\n" instead of "\s". This will still catch tabs and newlines, but allow spaces.

tomsm’s picture

Just applied the patch. Works great. Thanks!

I also had a problem with webform. When the last name had spaces, for example "Van der Voort", I received a mail from "Van". With the patch it is from "Van der Voort".

Jaesin’s picture

StatusFileSize
new868 bytes

I used a slightly different approach to fix this issue.

BrockBoland’s picture

Jaesin: can you explain the logic there? I haven't testing this, but I'm wondering if it would work correctly even if no from name is specified.

By way of example, if you only specify a from address with no name, would the value be:

info@example.com

or

"info@example.com" <info@example.com>

I think this last patch will only work with the second one.

yaworsk’s picture

I was having the same issue using the webform module - the from name was cutting off anything after a space.

Patch in #2 helped, thanks BrockBoland.

Pete

ailgm’s picture

#2 patch fixed it for us too. Thank you.

travishardman’s picture

StatusFileSize
new668 bytes

We created another different patch which fixes the issue for us. Thought I'd throw it in the mix.

shaundychko’s picture

StatusFileSize
new677 bytes

#2 does it, and here's a modern git version of the patch

asrob’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I would close because Drupal 6 has reached EOL (https://www.drupal.org/drupal-6-eol).