Send mail from php / PHPMailer

I just can’t make PHPMailer run on ExeOutput.

It runs well for a long time on php source on my computer (localhost, on Apache, through gmail account, SMTP authentication, withouth sendmail), but no SMTP connection can be established when running on ExeOutput.

I use standard PHPMailer (5.2):

include ‘mail/PHPMailerAutoload.php’;

$mail = new PHPMailer;


$mail->SMTPAuth = true;

$mail->Host = ‘’;

$mail->Username = ‘[email protected]’;

$mail->Password = ‘xxxxxxxxxx’;

$mail->SMTPSecure = ‘tls’;

$mail->Port = 587;

$mail->From = ‘[email protected]’;

$mail->FromName = ‘xxxxxxxxx’;


$mail->WordWrap = 50;


$mail->Subject = ‘xxxxxxxxxx’;

$mail->Body = ‘xxxxxxxxxx’;


I have tested SMTPSecure with ssl and tls, ports 465 and 587.

I have enabled php_curl.dll (with ssleay32.dll and libeay32.dll) and php_openssl.dll in ExeOutput.

In Oct 13, there was a similar blog by Stephanie, then closed as solved, but it won’t work on mine.

Does anyone have an idea?



Since you have an EXE file, make sure your firewall doesn’t block outgoing connections.

Unluckily, that doesn’t work.

I unblock port 587 (inbound/outbund rules) and the entire firewall. But still, PHPMailer does not run in ExeOutput.

No one out there to help with mail() or PHPMailer?

GDGSupport: I have paid for 2 years. Which workaround do you suggest?

I assume, I am/will not be only one to send emails from PHP.

First, you should try with another SMTP service than gmail, to see if it’s gmail that is blocking the connection or if the error lies in your application. A free SMTP online service:

Thanks for advice. Mandrill as SMTP online service looks very interesting.

I tested: Still negative. Error log shows that problems after attempting TLS connection:

2014-12-18 09:07:58 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS

2014-12-18 09:07:58 CLIENT -> SERVER: QUIT

Does ExeOutput bypass TLS sockets?

ExeOutput doesn’t do something on its side, it just runs the PHP code with the PHP runtime. However, contrary to an online website, you have an EXE application. So some third-party software like antivirus, firewall… can block incoming or outgoing connections.

Have you tried running this script under xampp/apache on that same machine?

Thanks for info. Finally, I managed to send emails from my ExeOutput. For those, who also struggle, here some documentation.

  1. In the old days, php’s mail was working well. Later on with increased SMTP authentication needs, PHPMailer is much better (and does not require painfull php.ini configuration).

  2. More and more email provider close on automatic mailing systems. Gmail is still fine with SMTP (e.g. through PHPMailer, use SSL and port 465).

  3. More professional is a specific email service, such as with good monitoring. (For basic services, good and free of charge). This works well on PHP, but not on ExeOutput (on my network, at least). Just register there, use TLS and port 587.

  4. To run in ExeOutput, you need another step: SMTP provider utility. There are a few, not many in the Internet. I use sendemail, a small portable program (just one file), no need for installation, just download the version with TLS support, and place it in the folder of your choice.

    It is run with parameters (well explained) and can be called from PHP through ExeOutput’s exo_runhescriptcom.

NB: At least in my computers (different OS), exo_runhescriptcom flushes an ugly DOS window. This can be avoided. But I dont want to mix topics here. Get back to me, if you need help.

Response to earlier question re xampp/Apache: Yes.