我正在尝试通过“email to sms”网关发送消息,因为我有以下代码:
<?php
require 'mailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '<my-email>@gmail.com'; // SMTP username
$mail->Password = '<password>'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom('<my-email>@gmail.com', 'abhishek');
$mail->addAddress('<mob-no>@bplmobile.com'); // Add a recipient
$mail->isHTML(true); // Set email format to HTML
$bodyContent = 'Hello world';
$mail->Subject = 'Demo Subject';
$mail->Body = $bodyContent;
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
?>
我从here获得了网关。
我已经尝试了链接中的所有网关,但似乎没有传递消息。