Hi,

I'm new to Drupal. Recently I downloaded Drupal 5.0 and used it to create a web-site. I separately downloaded the SMTP module and configured with necessary information. While sending test email, I'm getting the following error.

Error sending email: "The following From address failed: " From: "" To: "testaccount@yahoo.com"

The email address I've set in "Administer --> Site Configuration --> Site Information" page is being used for the From address.

Kindly help me to resolve this issue.

Thanks,
Abu

Comments

dsp1’s picture

i am also getting the error in the log and no email going out.
Error sending email: "SMTP Error: The following recipients failed

LukeLast’s picture

The email address I've set in "Administer --> Site Configuration --> Site Information" page is being used for the From address.

Based on the error message it looks like the from address is blank. How do you know it's being used?

If you're setting the address in "Site Information" I don't know why it would be blank. You could hardcode the from address on line 233 to test it.

jsm174’s picture

Hello.

I would like to add I had a "sort-of" similar problem when using the SMTP module with GMail. When someone would use my site-wide contact form, I would receive the email no problem, however the "from" address would be the GMail account I set up in the SMTP module.

So without paying attention, I would reply, and then the email would just come back to myself.

Through debugging, I found out that the "from" variable was correctly set to the user who sent the email. So I'm assuming GMail was automatically changing it.

Anyway, I corrected the problem by modifying the module to fill in the "Reply-To" with a copy of the "from" variable.

If anyone's interested I can post a copy of the patch.

Thanks,
-- Jason

LukeLast’s picture

Yeah, gmail will always overwrite the from address to match the gmail account address.

mike stewart’s picture

Hi jsm174, I'll probably be able to muddle my way thru and find it... but posting a patch or snippet would likely make it faster/easier for others.

does it seem like gmail changed something recently?

elruy’s picture

Hi Jason, I am also interested in the patch you made above (http://drupal.org/node/126147#comment-213306)

mike stewart’s picture

ok, apparently I can't muddle my way thru it ;-) and haven't been able to create a working solution... does the above mentioned solution work? Will (or can) the SMTP Module work with Organic Groups (OG) if I really spent the time to debug? Has anyone else? (if so, PLEASE post the patch).

Im using above mention modules on Drupal 5.1 - php 4.4.4

SMTP Module configured for smtp.gmail.com port 465 using SSL. works fine for some modules. but OG subscriptions are creating errors similar to the following:
Error sending email: From: <USERNAME <site_address@example.com>> To: <subscriber1@example.com> Error: The following From address failed: USERNAME <site_address@example.com>

Notify Module & Simplenews both seem to work fine... but OG subscriptions seem to send out email differently... (solution above suggests due to different user/email than system email - but its not clear to me). Has anyone had similar experiences? (Or is there a chance I'm missing something obvious)?

vitrag’s picture

Hey guys even i have he same problem, no idea how to fix this
i have drupal 5.1 in fc6 with apache and mysql
the smtp head module is installed and active
error is get is
-------
Error sending email: "SMTP Error: The following recipients failed: xxxxx@xxxxxx.xxx" From: "xxxxx@xxxxxx.xxx" To: "xxxxx@xxxxxx.xxx"
--------
any help on this will be really appreciated

one thing to note here is that i donot have sendmail configured on the linux box

gustav’s picture

The problem is that the smtp module, when it is given a From: field of the form 'name ', drops the bit between < ... >. The workaround is not to use that kind of syntax for the email address. The organic groups module for example uses this syntax by default but you can change that on the organic groups settings page.

Christoph C. Cemper’s picture

@delius: your "workaround is not to use that kind of syntax for the email address" is a work around this problem
but leads to the smtp.module sending our all emails with the "fixed from address", which was our initial problem
more at http://drupal.org/node/93162

it appears this issue is unchanged since 4.7x

scott.mclewin’s picture

I had the same problem with OG. The following patch allows for both the way OG subscriptions work and for the way smtp.module assumed From: fields were being filled out.

http://drupal.org/node/195622

oadaeh’s picture

Status: Active » Fixed

The fix for the from field problem has been committed here: http://drupal.org/cvs?commit=90638

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

zpr’s picture

Hi Jason,

I'd like to have a copy of the patch.

Thanks indeed.

Regards

Pascal

geremiadoan’s picture

When setting up Drupal on my home server, it was very easy to just install the SMTP support module and use Gmail's SMTP settings. I therefore assumed the same would work on my GoDaddy shared hosting account. I was mistaken; I was not able to send an email from Drupal no matter what with SMTP module installed.

I scoured Drupal.org and nothing.

Here is how to allow Drupal to send email from within a GoDaddy shared host:
1. Uninstall the SMTP module.

That's it; apparently GoDaddy has the server set up to allow Drupal to send email without the SMTP module.

willvincent’s picture

I imagine it depends on which type of hosting you have set up.. I've always used linux based hosting from GoDaddy, and the internal mail function has always worked just fine. I'm not sure how this works on a windows based hosting solution, but I believe in that instance php is configured to make the mail() function work with an smtp server anyway, so in that case the built in mail functionality should work as well.

GoDaddy is good. :)

skj’s picture

Status: Closed (fixed) » Active

I have downloaded the latest version of the module (June 2008) and tried even July 2008 development version for Drupal 5. I am still facing the same problem many have discussed. The error is
Error sending e-mail from postmaster@xxxxx.com to xxxx@yahoo.com: SMTP Error: The following recipients failed: xxxx@yahoo.com

Also if I use from address diffrent from that of the website, I get the error

Error sending e-mail from yyyy@xxxx.com to xxxx@yahoo.com: SMTP Error: The following From failed: yyyy@xxxx.com

Any help would be deeply appreciated.

oadaeh’s picture

Status: Active » Closed (fixed)

@sunilkjain: your issue is most likely different than this one. Please create a new one instead of reopening this one.