How can I configure PHPMailer on localhost
to send email by connecting through a proxy, as the direct connectivity to smtp server (smtp.google.com)
is blocked by the network admin.
Also guide me if there is a substitute for PHPMailer that can use proxy, in case proxies can't be configured for PHPMailer.
Please guide.
I am using following code to send email:
<?php
require 'send/PHPMailerAutoload.php';
$info = $_POST['msg1'];
$data = json_decode(stripslashes($info));
$email = $data->email;
$fName = $data->fName;
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'abc@gmail.com';
$mail->Password = '**********';
$mail->SMTPSecure = 'tls';
$mail->From = 'abc@gmail.com';
$mail->FromName = 'ABC';
$mail->addAddress($email, $fName);
$mail->addReplyTo('abc@gmail.com', 'ABC');
$mail->WordWrap = 50;
$mail->isHTML(true);
$mail->Subject = 'demo msg';
$mail->Body = "hello friend!!";
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message sent!";
}
?>