My server info:
PHP: 5.2.x
mySQL: 5.0
Apache: 2.3.x
Drupal: 4.7.4

I configured the PHP mail() function as below:

[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 587

; For Win32 only.
sendmail_from = sheffield.uncensored@gmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

I get the error:
mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first 34sm37909119wra in C:\Apache\htdocs\8080.localhost.drupal\modules\user.module on line 431.

Outgoing gmail e-mails require TLS, and username and password. Is there a way to set drupal up using mail() function to handle the TLS requirement or some sort of addition to do that.

I'm new at running Drupal, and new at setting up PHP and everything else.

Hopefully it's a simple fix.

Comments

steve hanson’s picture

The easiest way to to this would be to install and configure the SMTP module, which sends email directly rather
than through the PHP mail function

Steve Hanson
Principal Consultant Cruiskeen Consulting LLC
http://www.cruiskeenconsulting.com

Steve Hanson
Publisher Eye On Dunn County
https://eyeondunn.com

Miss Essence’s picture

I tried that out since it was such a simple thing to do. Unfortunately drupal threw these errors:

    * warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Apache\htdocs\8080.localhost.drupal\modules\smtp.module on line 1834.
    * warning: fsockopen() [function.fsockopen]: unable to connect to smto.gmail.com:587 (Unknown error) in C:\Apache\htdocs\8080.localhost.drupal\modules\smtp.module on line 1834.
    * warning: fsockopen() [function.fsockopen]: unable to connect to :587 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\Apache\htdocs\8080.localhost.drupal\modules\smtp.module on line 1834.
steve hanson’s picture

Looks like you typed in the node name wrong - note that it says smto.gmail.com ----

Steve Hanson
Principal Consultant Cruiskeen Consulting LLC
http://www.cruiskeenconsulting.com

Steve Hanson
Publisher Eye On Dunn County
https://eyeondunn.com

Miss Essence’s picture

I corrected that but its still not sending mail.

I will test for error specifics in a bit. :)

Miss Essence’s picture

Now its all the correct information and its throwing this error:

Error sending email: The following From address failed: sheffield.uncensored@gmail.com From: sheffield.uncensored@gmail.com To: kristinahall.83@gmail.com

Miss Essence’s picture

I uninstalled all of drupal and put in the new version (yay for 5.0).

And I'm having issues now the 5.0 version of the SMTP module. or the "HEAD" version.

http://drupal.org/node/109729

mishhh’s picture

i receive the following errors with gmail smtp server:

    * warning: fsockopen(): unable to connect to smtp.gmail.com:587 in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.
    * warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.
    * warning: fsockopen(): unable to connect to :587 in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.

I tried with both ports 465 and 587. And I tried with both tls and ssl...

:)

ehudhal’s picture

Hi,

I'm using Drupal 5.1.0, and I installed the smtp module.

I'm getting the following when trying to send an email with a password to myself:

* warning: fsockopen() [function.fsockopen]: unable to connect to smtp.google.com:587 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\www\webapps\drupal\modules\smtp_auth\smtp.module on line 1878.
* warning: fsockopen() [function.fsockopen]: unable to connect to :587 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\www\webapps\drupal\modules\smtp_auth\smtp.module on line 1878.

I also tried to open port 587 in the firewall since I read somewhere that works, but it doesn't seem to work either.

any suggestions?

also, how do you choose between ssl and tls? I don't see this option in the SMTP module settings.

Thanks.

oliopur’s picture

I've find this on a forum....

In my case I had the error :
Warning : mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. ...

I hadthe SMTP.gmail.com in php.ini file
I have put :
SMTP = gmail-smtp-in.l.google.com
instead and IT WORKS FINE

I suppose that there is another SMTP working with all other.