CodeIgniter 中显示“电子邮件已发送”按摩 未收到电子邮件

'email has been sent' massage is shown email is not receiving in CodeIgniter

提问人:Renish Batada Social media 提问时间:12/4/2022 更新时间:12/4/2022 访问量:20

问:

我用过CodeIgniter 2.2.6

我正在尝试发送电子邮件,但我无法收到错误并且未收到电子邮件

<?php   
      class email_otp_demo extends CI_Controller
      {
           public function index()
      {
           $this->load->library('email');
           $config = Array(
            'protocol' => 'smpt',
            'mailpath' => '/usr/sbin/sendmail,
            //'mailpath' => 'www.google.com', also try
            'smtp_host' => 'smtp.gmail.com',
            'smtp_port' => 587,
            //'smtp_port' => 456, also try
            'smtp_user' => '[email protected]',
            'smtp_pass' => 'mypassword', 
            'smtp_timeout'=>50,
            'mailtype' => 'text',
            'charset' => 'iso-8859-1',
            'wordwrap' => TRUE,
            'newline' =>'\r\n'
           );
        //    glnlwboynexfjqxj
     $this->email->initialize($config);
    
    $this->email->set_newline("\r\n");
    $this->email->set_crlf("\r\n");        
    $this->email->from('[email protected]', 'Social media website');
    $this->email->to('[email protected]');
    //$this->email->to('[email protected]'); also try this
     
    // $this->email->cc('[email protected]');
    // $this->email->bcc('[email protected]');
        
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
        
    echo $this->email->send();
        echo "<hr>";
    echo $this->email->print_debugger();
    
}

 }

 ?>

我得到了以下输出,但没有收到电子邮件

    1
Your message has been successfully sent using the following protocol: mail
User-Agent: CodeIgniter
Date: Sun, 4 Dec 2022 16:53:27 +0530
From: "Social media website" <[email protected]>
Return-Path: <[email protected]>
Reply-To: "[email protected]" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
=?iso-8859-1?Q?Email_Test?=
Testing the email class.

我还尝试启用和禁用步骤验证 但未收到电子邮件

我使用应用程序密码和原始密码,但无法工作

电子邮件 CodeIgniter-2

评论


答: 暂无答案