1
votes

I need to send mail using PHP Mailer.

Mail is sending but not received in gmail. In phpmailer folder i have 3 files: class.phpmailer.php, class.smtp.php, PHPMailerAutoload.php

require 'phpmailer/PHPMailerAutoload.php';

    $mail = new PHPMailer;
    $mail->isSMTP();

    $mail->Host='smtp.gmail.com';
    $mail->Port=587;
    $mail->SMTPAuth=true;
    $mail->SMTPSecure='tls';

    $mail->Username='[email protected]';
    $mail->Password='password';

    $mail->setFrom('[email protected]','Company');
    $mail->addAddress('[email protected]');
    $mail->addReplyTo('[email protected]');

    $mail->isHTML(true);
    $mail->Subject='New Form Submission';
    $mail->Body='<h1>Hello</h1>';

    header("Location: ../123.php");
1
Do you get an error?SLaks
It seems like you are using an outdated version of phpmailer, my first step would be to try to update phpmailer.GrumpyCrouton
@Mix Did you read the very first question of the linked answer? Or did you just immediately dismiss the idea that it could be helpful? You've also confirmed that you are, in fact, using an outdated version of PHPMailer. 5.2 has been completely unsupported (not even security updates) since the beginning of this year.Patrick Q
@GrumpyCrouton Right. I was pointing out that while OP seems to be arguing that it is not out of date, that they were in fact proving that it is.Patrick Q

1 Answers

-2
votes

Try using the debug mode in PHPMailer: https://github.com/PHPMailer/PHPMailer/wiki/SMTP-Debugging

This will show you additional information on the exchange.