phpemailsendmail.exe

sending email to gmail in php codeigniter


I have to send email to gamil for registration of account in my website. I am using wamp ,win 7, codeigniter. And sending mail through sendmail. I have made all required changes i.e

in php.ini

; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
;sendmail_from = myemail@gmail.com
sendmail_path ="C:\wamp\sendmail\sendmail.exe -t" 

And in sendmail.ini

smtp_server=smtp.gmail.com
smtp_port=465
auth_username=myemail@gmail.com
auth_password=mypassword

But it shows this error instead of sending email.

Message: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Filename: libraries/Email.php

It is still giving error on port 25 but i am using port 465. What could be the possible reason of this? What I am doing wrong? Any help.


Solution

  • I just made those changes in C:\wamp\bin\apache\apache2.2.22\bin\php.ini instead of C:\wamp\bin\php\php.ini. And it works :)