how is Drupal able to send an email from your gmail account?

mrbkonline - December 21, 2007 - 03:49

Hi,

When I first turned up my Drupal site, I gave the "site information" email as my gmail address and it worked great, i.e. when people signed up they received an email from my gmail address. BUT how is Drupal doing that? I never gave it my gmail login/pw? Does it "spoof" the email? And if so, where/how can I track what emails have been sent?

thank you in advance for your help!

Much simplier than that

nevets - December 21, 2007 - 04:14

When you send email out (in this case using the PHP function mail) you typically can (and may need to set) who the mail is from. The mail never actually goes through the mail "host", in your case gmail, so it does not need a login or password. In Drupal's case if drupal_mail is used to send the email if now from address is provided the function used the email that is part of site information to set the from email address

no mail server - potential mail delivery problems??

mrbkonline - December 24, 2007 - 22:54

Some of my users said they never received their first "sign up" email (signup to my website requires a valid email address).
(This was the reason I posted this thread, to try to understand how the email works).

I'm hosted with Bluehost, and I did see some delivery failure messages in my inbox that corresponded to users that told me they never received the sign on email, and I confirmed that they had given valid email addresses.

If a PHP function is sending email, and the receivers email server is busy, will it retry or give up? If it retries, then for how long?

thank you

There are many potential

dman - December 24, 2007 - 23:23

There are many potential points of failure, but the likelyhood of failure should be low.
Worst case scenario:
PHP code failure/timeout during the initial creation of the mail.
- but if they get the "an email has been sent" message, on the screen thats not a problem.
Seeing that message also means that the inital host - the first step in the delivery chain has been contacted OK

The email then hops across the network. Queuing and retrying as needed to get around any momentary network problems ... up to a few weeks if neccessary, but usually, obviously, within seconds.

BUT the most likely answer ... and one which bears on your first Q.
Your email is coming from one machine (your webserver), but claiming to be from another (gmail).
This is a warning sign for spam
It's not illegal for email to be mis-labelled like this, BUT it will add a flag to many spam filters.
You are going to have to check the spam buckets

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

so how to get Drupal to use my bluehost mail server?

mrbkonline - January 4, 2008 - 03:06

thanks, I am now clear on what is happening.

...but I still continue to get delivery failures for some valid users...

I'm hosted with bluehost and I have a my own web domain name as the email domain (so I don't need to "fake" gmail anymore).
How can I get Drupal to tell my mail server to send the mail (instead of using phpmail) so the mail doesn't get flagged as spam?

thank you

How php.ini is configured?

Optalgin - March 10, 2008 - 14:29

I'm trying to use gmail as my site email but it doesn't work (outgoing messages fail)
I was surprised it worked for you without any special configuration
Can you explain how your email account is configured in php.ini/mail.inc etc.. ?

Thanks

That's an excellent question Optalgin

scifisi - October 1, 2009 - 08:56

It's a shame it's been over 1 and a half YEARS and still no one bothers to reply, still never mind eh?

An answer would be nice maybe by 2017 either through the process of osmosis, or the infinite monkey/typewriter scenario they might have resolved themselves.

I'll bookmark this page, if I work out sending through GMail I'll write back for the sake of posterity.

You can use SMTP module

Optalgin - October 1, 2009 - 22:08

You can use the SMTP module it works very well

The only problem is had is that gmail/google blocked my account few times (for a short period)
mistakenly identified my site's group e-mails as spam and me as a spammer.

Eventually I switched to a different mail service (but still using the SMTP module)

Sorted

scifisi - October 1, 2009 - 23:38

Threre's a great module check it out it's called SMTP Auth, you will need to download some code from http://phpmailer.sourceforge.net phpmailer 2.2.1 should do. copy the contents of phpmailer directory into sites/all/modules/smtp directory and you should be up and running...

:)

 
 

Drupal is a registered trademark of Dries Buytaert.