简体   繁体   English

为什么我在Phpmailer中收到邮件延迟?

[英]Why i am getting mail delayed in Phpmailer?

I am using PHPmailer for sending mail, But email is sending so late to the customer, sometimes it didn't send. 我正在使用PHPmailer发送邮件,但是电子邮件向客户发送的时间太晚,有时没有发送。 Can anyone tell me what is the reason? 谁能告诉我原因是什么?

My PHPmailer setting:- 我的PHPmailer设置:

public function sendemail($to,$msg,$subject)
{
    require_once(APPPATH.'third_party/PHPMailer-master/PHPMailerAutoload.php');

        $mail = new PHPMailer;
        $mail->isSMTP();                     
        $mail->Host = 'maddbas.nexcess.net';
        $mail->SMTPAuth = true;
        $mail->SMTPSecure = "tls";
        $mail->Username = 'myusername'; 
        $mail->Password = 'mypassword';
        $mail->Port       = 587;    
        $mail->setFrom('test@gmail.com', 'test');
        $mail->addReplyTo('test@gmail.com', 'test');
        $mail->addAddress($to);

        $mail->isHTML(true);
        $mail->Subject = $subject;
        $mail->Body    = $msg;
        $mail->send();
}        

Actually, This isn't PHPMailer issue. 实际上,这不是PHPMailer的问题。 This is happening because of your hosting provider! 这是由于您的托管服务提供商而发生的!

Some hosting provider doesn't allow you to set from recipient except your own domain name or it may delay mail. 除您自己的域名外,某些托管服务提供商不允许您从收件人进行设置,否则可能会延迟邮件。

If you have cpanel access, You can track delivery report in email tab. 如果您具有cpanel访问权限,则可以在“电子邮件”标签中跟踪传递报告。

I would you like to suggest you to use strong email providers! 我想建议您使用功能强大的电子邮件提供商!

Like: Elasticemail Sendgrid Mailgun And so on.... 像: Elasticemail Sendgrid Mailgun等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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