I've already set sendmail_path to the path of 'sendmail.exe', but PHP didn't send email. it requires mail server or something.
PHP said can't connect to localhost at port 25. The fun fact in the php.ini file is that above the path to 'sendmail.exe', stated "Unix only!????", but 'sendmail.exe' is Windows executable. [i believe the sendmail.exe i have in XAMPP is windows version of the Unix sendmail, so the comment in php.ini might not be at right place]
I'm just only sending email, not receiving email, so why do i need a mail server (like Mercury)? or the SMTP (the protocol) requires a server for both sending & receiving?
As per my thinking, we can just open the port (usually 25? 465?) of the destination server to send message to. Anything wrong in my procedure here and above?
Just can't find the details in similar Stackoverflow questions so i bring up this matter, please help me get enlightened.
Only because you find a file called
sendmail.exe
on your computer it does not mean that PHP supports that specific binary out of the box.From
sendmail_path
:Double check that
sendmail.exe
on your disk is compatible with PHP.Try:
You don't need to. It's only likely that the configuration you use with
sendmail.exe
(that's not the PHP configuration, look forsendmail.ini
instead) that you have toldsendmail.exe
to use an SMTP server.Either change that, and if
sendmail.exe
does not provide the feature you're looking for, replacesendmail.exe
with something that matches your needs.It's just that by default it actually makes sense to send emails. So why are you upset about a configuration that makes sense?
See also: