PHPMailer 1.73 with SSL Support
PHPMailer is a great email component for PHP, however, it lacks the support of connecting to SMTP servers that requires SSL (such as GMail). Therefore, I've modified this version to add a "IsSSL()" method to the class to handle this.
Download HERE
Remarks: In order to use SSL SMTP connection, the OpenSSL extension has to be enabled in php.ini:
extension=php_openssl.dll
Sample Code:
|
<?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->IsSSL(); $mail->Host = "smtp.gmail.com"; // specify main and backup server $mail->Port = 465; $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "youruserid@gmail.com"; // SMTP username $mail->Password = "yourpassword"; // SMTP password $mail->From = "sender@sender.com"; $mail->WordWrap = 50; // set word wrap to 50 characters $mail->Subject = "Here is the subject"; if(!$mail->Send()) echo "Message has been sent"; |
