Can't see mail log when using PHPMailer but if I use simple php mail() function i can see log


mail.log = "c:/wamp/logs/maillog.log"

PHPMailer_Email.php (Using below script, it doesn’t write log in specified file but send email.)

include 'vendor/autoload.php';
  $mail = new PHPMailer;
  $mail->SMTPDebug = 2;
  $mail->Host = "";
  $mail->Port = 25;
  $mail->From = $from;
  $mail->FromName = "From Name";
  $mail->addReplyTo($from, "Reply");
  $mail->Subject = $subject;
  $mail->Body = $body;
  $mail->AltBody = $body;
    echo "Mailer Error: ". $mail->ErrorInfo; die();
    echo "Message has been sent successfully";

Email.php (Using below script, it write log and also send email)

mail($to, $subject, $body);

Could anyone suggest how I can enable PHPMailer to write mail log in maillog.log file?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.