PhpMailer, mail without SMTP server
Hello,
I would like to know if someone has a solution for integrating PhpMailer into ExeOutput.
In php code, I get my mail (from gmail.com), no mater what config I have in the php.ini, it works perfect.
But once I compile it with ExeOutpout I get a the following error: “SMTP Error: Could not connect to SMTP host”.
Any ideas?
:mrgreen: I found the solution:
1 - In the PHP Settings -> PHP Extensions you must compile into the EXE the php_curl.dll (agree to include the ssleay32.dll and the libeay32.dll), and the php_openssl.dll
2 - Download the PhpMailler (I’m using the 5.1)
3 - Create or use a valid gmail account
4 - Change the settings on the next example :
<?php
require("PHPMailer_v5.1/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // Telling the class to use SMTP
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Username = "[email protected]"; // "The account"
$mail->Password = "yourpassword"; // "The password"
$mail->Port = 465; // "The port"
$mail->Subject = "My first email "; // "The subject"
$mail->Body = "This is a test"; // "The message."
$mail->WordWrap = 100; // "The lenght of the text."
if(!$mail->Send()) {
echo "Message was not sent.";
echo "Mailer error: ". $mail->ErrorInfo;
} else {
echo "Message has been sent.";
}
?>