0
votes

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.

1
Well, what platform are you on? - Pekka
So basically you want to send emails from a windows box using sendmail.exe you found somewhere? - Furicane
@Pekka i'm on windows 7 with XAMPP - jondinham
@Furicane: my 'sendmail.exe' is in the XAMPP package (which inludes Apache,PHP,FileZilla,Mercury) - jondinham
nevermind, you actually need a smtp server running "somewhere", either localhost or a public wide open smtp. so, yes you do need a smtp server either for php mail, swift mailer etc. There are also smtp libs like hamster that work, but it is too a smtp server running locally. - TigOldBitties

1 Answers

1
votes

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:

[...] This directive works also under Windows. If set, smtp, smtp_port and sendmail_from are ignored and the specified command is executed.

Double check that sendmail.exe on your disk is compatible with PHP.

Try:

sendmail_path = "X:\path\to\sendmail.exe -t"

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?

You don't need to. It's only likely that the configuration you use with sendmail.exe (that's not the PHP configuration, look for sendmail.ini instead) that you have told sendmail.exe to use an SMTP server.

Either change that, and if sendmail.exe does not provide the feature you're looking for, replace sendmail.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: