1

I have tried to send a mail using php and sendmail. It looks simple but my configuration seems not to working.

My sendmail.ini

smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=587

; SMTPS (SSL) support
;   auto = use SSL for port 465, otherwise try to use TLS
;   ssl  = alway use SSL
;   tls  = always use TLS
;   none = never try to use SSL

auth_username= my-address@gmail.com
auth_password= ***** (my pwd)

Part of my php.ini

; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"

My simple php

mail('xxxx@xxx.com', 'test msg', 'best messages', 'From:xxx@xxxx.com');

I don't receive anything in my mailbox. I also checked my spam folder. After my configurations in sendmail and php.ini files, I restarted the Xampp Apache but nothing change.

I also tried port:25 or 465 or 587

Do I make errors ?

Any help would be great.

Benjamin Lucas
  • 370
  • 5
  • 20
  • You should check sendmails log files to see what is going on. Typically that is something like `/var/log/maillog`. I see that you are on an MS-Windows platform where networking things are always strange, so you will have to dig around a bit for the location of that log file. – arkascha Nov 15 '15 at 10:25
  • I got this message in my xampp/sendmail/errors file : Connection Closed Gracefully. – Benjamin Lucas Nov 15 '15 at 11:12

1 Answers1

0

by any chance do you want to use a third party mailer? Like php mailer? Here phpmailer . I am using this whenever I'm on my development stage where I need to send mails and when I'm on live server I switch back to php mail function wherein it's already configured unlike when you are in your local machine. Hope that one helps.