简体   繁体   中英

XAMMP Sendmail issue

I am having an issue getting my sendmail to work in Xammp.

The mail was working perfectly when using sendtodisk but now I get a crash log using sendmail:

PHP to send emails (Using PHP Mailer):

$mail = new PHPMailer;

$mail->setFrom($from_email, 'Thomas ****');

$mail->addAddress('thomas@****.co.za', 'Client');

$mail->Subject = 'Sign Offs';

$mail->Body = generateMailTemplate($job_id, $to_email, $from_email, $name);

$mail->addAttachment('tmp/'.$job_id.'.pdf');
$mail->isHTML(true);  

if (!$mail->send()) {
    return $mail->ErrorInfo;
} else {
    return true;
}

php.ini

sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"

sendmail.ini

smtp_server=outbound.mailhop.org
smtp_port=25

crash.log

command line      : C:\xampp\sendmail\sendmail.exe -t -fthomas@****.co.za

Any ideas?

try to set smtp settings for your phpmailer script, not for php

$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'outbound.mailhop.org';
$mail->Port = 25;
// if need auth
$mail->SMTPAuth = true;
$mail->Username = 'user';
$mail->Password = 'password';
$mail->Subject = 'subject';
$mail->Body = 'body';
$mail->send();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM