Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii-user: send activation mail

Tags:

php

email

yii

I've implemented the yii-user module in a new php project and everything works fine. But when i register, the program should sent an activation email , but when i press the register button i get the following error:

mail() [function.mail]: Failed to connect to mailserver at >"localhost" port 25, verify your "SMTP" and "smtp_port" setting >in php.ini or use ini_set()

I've searched and i changed my ini file to:

; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 465 
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]

But that didn't help.

How do i solve this

like image 780
Jens Cocquyt Avatar asked Nov 30 '25 18:11

Jens Cocquyt


2 Answers

It seems your problem is that Gmail is not an open relay, meaning it requires authentication with an account in order to accept outgoing mail. See the Gmail page Problems sending mail. At the very least, you'll need to supply account information, and I don't see that in your example.

like image 90
eh9 Avatar answered Dec 03 '25 07:12

eh9


Check to see if your hosting services is blocking port 465

like image 34
Sonny Avatar answered Dec 03 '25 07:12

Sonny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!