Hello,
I recently finished a site where people create their own accounts with email verification and then can go back and create a CCK content.
Both the user registration emails and the Rules notification emails (send to an arbitrary address) were working, but sending very slowly. I thought this might have something to do with the GoDaddy hosting. So I looked into the phpmailer and SMTP-authentication modules. I installed both of them (one at a time), seemingly correctly after finding the class.phpmailer.php and class.smtp.php files online, but when I tested either one using my Gmail account for SMTP, neither worked. In the Reports log it said they couldn't connect to the SMTP server and the emails failed. Then I tried uninstalling them and deleting them and going back to the old, very very slow email, but now the site is sending NO emails: no user registration emails, no contact form emails, no Rules based emails. But in the Reports log all these emails are labeled successful. I'm sure there's an easy solution here but I am completely at a loss. Has anyone experienced this type of problem before? Is there a good place to start looking for an answer? (I've gone through a lot of the forums but haven't found this specific problem, and I've tried a lot of what is mentioned, i.e. -2 hack for the modules, TSL vs. SSL, etc.). If more information is needed please let me know - I can get very detailed. Thank you for any help you may be able to offer! Yikes!
Andy

PS I wasn't sure where to post this so I put it in Theme Development

Comments

wahlrus’s picture

Hello,
I used an sql file from my local installation that I never installed the phpmailer or SMTP-authentication modules on, in case that had something to do with the problem, but alas still no email, even when I tried "Request New Password," - not only does the email not send, but the passwords aren't reset (the old ones still work). Does that provide any clues?
Thank you,
Andy

yelvington’s picture

Theme development is for development of themes. This has nothing to do with themes.

Drupal does not send mail itself. It uses a PHP function to hand mail to an external transfer agent for processing and delivery. If your mail is slow, you should contact your hosting provider and get them to fix it. It's outside Drupal.

Either of the modules you mentioned can be used to replace Drupal's normal mail handling with a connection to an external relay via SMTP, but the module must be properly configured and the external relay has to allow you to do so. Most mail service providers limit the number of emails you can send that way.

wahlrus’s picture

The list of options of places to post this was confusing to me - would this go under "Post Installation" then?
I understand it is GoDaddy that is being slow, but at this point slowness is not the problem. I would love to go back to slow!
But even the "Request new password" isn't working - I do not understand that, because if Drupal believes that the mail was sent, even if the PHP function failed to send it, wouldn't the password change?
And for the modules, I haven't found that Gmail poses any problems for others in the forums, or if it does they switch between SSL and TSL.
The one Gmail-side possible issue (as I understand it) is having POP enabled, which it is, and for the module configuration, I have it set to port 465, at smtp.gmail.com, with my username and password.
I understand this doesn't much belong in theme development, and I would be happy to post it in the appropriate place, I don't have many options but posting at this point because I seem to have exhausted the research opportunities.
Thank you for your time,
Andy

vbplusme’s picture

Do you have or did you install the SMTP module on your site? If so, it has a debugging setting that can help you figure out where the problem is. Also, I think you may have a misinterpretation about what the reset password does. Usually, the email contains a link that allows the user to go in and change their password but the "reset" does not occur until they enter they actually enter the new password. All the lost password routines I know about work that way. BTW, I installed the SMTP module here on my local machine and pointed it at my ISP account, worked like a charm without any phpmailer install. You might want to recheck you google setup against what they have posted on their site : http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

As a followup, I enabled SSL on my local system and was able to use gmail to send SMTP emails, no problem, so I know the SMTP module (from here : http://drupal.org/project/smtp) works. I installed the v7 version. HTH

wahlrus’s picture

Thank you for offering your help and time on my problem.
I am using Drupal 6.19 so I couldn't use the v7 module, which comes shipped with phpmailer already. So for the v6 smtp, I noticed it said "not supported for phpmailer versions higher than 2.2.1," and I really hoped that was the problem, so I downloaded several versions of phpmailer and made a directory in the smtp folder, as per the installation instructions. each version, 2.1, 2.2.1, and I tried 2.3 as well, gave me the same error logs (after I turned on "Debugging") :

fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection refused) in /home/content/a/f/w/afwghost/html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
(two more similar to this) and then:

smtp: Error sending e-mail from blank@gmail.com to test@gmail.com : SMTP Error: Could not connect to SMTP host.
mail: Error sending e-mail (from blank@gmail.com to test@gmail.com).

So I went back and tried phpmailer v5 and it gave just the last two errors, minus the fsockopen stuff.

Then I figured it could be a firewall from my GoDaddy shared hosting account, so I went in an made an email account with them, for the smtp server name and tried that with ports 25 and 80 instead of gmail and still got the same errors.

But I encountered what may be the problem, I noticed that when I pressed "save configuration" and the page reloaded, the password field still had 11 characters, when the new password only has 7. I can't seem to get rid of the 11 characters - I don't know if the error log would read "Could not connect to SMTP. Wrong password" or something specific like that, but that could be the reason this isn't working.

Of course, I can't help but think that this whole SMTP/PHPmailer problem is connected to the problem that I can't get emails to send without these modules, either.

Any further suggestions are greatly, greatly appreciated.
Thanks,
Andy

vbplusme’s picture

Sorry about that. Okay, I installed the v6 SMTP to my v6 Test System and downloaded ONLY 2.2.1 from phpmailer. I created a folder in the SMTP module /phpmailer and only copied the class files from 2.2.1 to it ( class.phpmailer.php, class.pop3.php, and class.smtp.php). I enabled the module and filled in the details including setting the SSH parameter. It complained about my TimeZone configuration but gmail sent the test email. I fixed the TimeZone problem and it works great!

I think you are trying to do too many things at the same time. Also, you need to use REAL email addresses with gmail and the "whole email address" is the username not just the username part of it. Keep it simple! It will make your troubleshooting more productive. HTH

wahlrus’s picture

That 11-character password business was a dead-end. I switched over to the PHPmailer module and could see the new password but I got the same error logs.
Back to the drawing board.

wahlrus’s picture

just got off the phone with godaddy and they said there shouldn't be any problems there either.
so,
1. email was slow
2. used smtp module
3. couldn't get it to work so i uninstalled it
4. email didn't work at all from that point
5. tried smtp again, with gmail and godaddy email accounts
6. all return the same error: "could not connect to smtp host"

aye yay yay

wahlrus’s picture

I tried all of the above on another drupal website i have, and got the exact same error messages.
how do you enable ssl on your local system?

wahlrus’s picture

sorry for the last question that was obvious..

vbplusme’s picture

I noticed that when I entered the data in the SMTP screen, Drupal needed to enable the items in a particular order for them to work correctly. I was trying to do it all in one shot, set the configuration and send the test mail. I should have done the "enable" then set the configuration parameters, then send the email test as separate actions ( saving them as I went along ) to be sure that they were all enabled correctly, fyi.

Zohan’s picture

hey ... I really really need to solve this exactly same problem !!!
godaddy hosting (linux)
3 websites with one drupal 6 instalation
No errors ! even with webforms, contact form, request password, smtp module .. etc - no email.! nothing.
and the worst thing is - it used to work just fine .... and I have no idea when and how it stopped ....
Plz ..

vbplusme’s picture

According to the GoDaddy Support people that Wahlrus talked to, its suppose to work. Assuming that they are being truthful, though you should try to run phpinfo.php on your site to check your php configuration to be sure.

Google/Gmail is VERY specific about what they require to use their smtp servers.

I was able to get this working on a stand alone server behind a firewall so being "on the net" ought to be easier to do.

1. Make sure you have the SMTP module installed and enabled. I have this module install (http://drupal.org/node/873892).

2. Downloaded the phpmailer 2.2.1 from : http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6...

3. Unpack the phpmailer in a temp folder.

4. Create a /phpmailer folder in the SMTP module and only copied the class files from 2.2.1 extract to it ( class.phpmailer.php, class.pop3.php, and class.smtp.php) to simplify things (the module doesn't care about the rest of the stuff in the phpmailer distribution).

5. Set the Module up to use gmail smtp. /admin/settings/smtp > should get you to the SMTP setup screen.

a. SMTP Server : smtp.gmail.com

b. SMTP backup server: leave it empty

c. SMTP port: 465

d. Use encrypted protocol: USE SSL (Google Requires it!)

e. Username: user@gmail.com (you need to use your whole gmail address for the username)

f. password: (the gmail account password)

g. E-mail from address: (this should be your drupal system or administrator email address)

h. E-mail from name: (if you don't put a name here gmail puts something stupid in there, like user name.)

i. E-mail address to send a test e-mail to: ( you can put any test email address in here)

j. Save Configuration and you should be good to go with no errors in the sent email error log...

k. Check the email account of the test email and it should have a success message in the queue.

You have to be precise about the setup because gmail is VERY particular about what it accepts and what ports are to be used. If things fail, they may or not report why the failure occurred. You should not need the drupal debug but its there it things don't work out the way they should. Checking the debug box gives you a LOT of details about the SMTP output for EVERY Message sent so you should use it judiciously.

ejb’s picture

GoDaddy doesn't allow you to use outside SMTP relays (i.e. GMAIL). You must use there's.

Also, your steps are correct and I have followed them exactly. However, much like the original poster, I am having the exact same issue. SMTP fails to authenticate when I send a test or use my online form, regardless of if I use PHP Mailer 2.2.1 or 5. Version 5 used to work until a couple of days ago.

It seems that GoDaddy has made some changes to the backend. I called support, but they were of no help. I am at a loss as to how to proceed. I really need this working!

vbplusme’s picture

I found the following on another site, log into your gd account,

* Click on the Settings tab
o Click on Display Settings menu item
* Click on the Other tab
* Check the Use Full-Time SSL Mode checkbox
* Click the OK button

Also, it appears that GoDaddy is using that same port, check this out:

Changed GoDaddy account to: "use full time ssl"
(Despite GoDaddy support rep telling me I couldn't use SSL on my email account!)

In Gmail used:
smtpout.secureserver.net
Port 465
me@domainname.com
My godaddy password

Ralf1’s picture

Mysite uses GoDaddy hosting. My emails (notification emails and the like) didn't reached recipient addresses.
I tried to use SMTP-authentication module but I didn't manage to make it work and had to refuse it.
Finally I found the reason of the problem.
In the settings of Drupal (v.6.20) for my site (in Site configuration section)
E-mail address (From address) was set as myemail@gmail.com
when I changed it to myemail@mysite.com (mysite.com uses GoDaddy hosting)
my emails reached destination addresses at last.
Additional problem was found when email contained non-latin characters (russian characters)
There was an error when emails were sent.
I solved it using advice from http://drupal.org/node/196792
and corrected mail.inc file as was proposed in
http://drupal.org/files/issues/84883_subject_newline_d7_2.patch

Ralf

smithandrews’s picture

SMTP Server: relay-hosting.secureserver.net
SMTP User: abc@yourdomain.com
SMTP Passwork: leave blank
SMTP Port: 25
SMTP Authentication: No
SMTP Encryption: None

owntheweb’s picture

Ah! This worked for me. Simple. Thanks.

Worlds to explore. Worlds to create.
Blog: http://www.christopherstevens.cc/blog
Twitter: http://www.twitter.com/owntheweb