簡體   English   中英

沒有SMTP的CodeIgniter電子郵件不起作用

[英]CodeIgniter Email without SMTP not working

我正在使用CI電子郵件模塊,但無法正常工作。 我沒有SMTP憑據,因此請嘗試使用此代碼。

   $this->load->library('email');
    // Send Emails
    $config = Array(
        'mailtype' => 'html'
    );
    $this->email->initialize($config);
    $this->email->set_newline("\r\n");
    $this->email->from($from);
    $this->email->to($to);
    $this->email->subject($title);
    $this->email->message($message);
    //$this->email->send();
    if ($this->email->send()) {
        $this->email->clear();
        return true;
    } else {
        die(show_error($this->email->print_debugger()));
        //return false; 
    }

出現此錯誤

在此處輸入圖片說明

電子郵件通常由電子郵件服務器發送。

如果您未指定SMTP服務器,則您的電子郵件模塊正在嘗試使用內置的php 電子郵件功能發送電子郵件。

但是這個功能不能做魔術。 它還需要一個功能齊全的SMTP服務器/代理。

默認情況下,在Unix平台上,它使用本地SMTP服務器,該服務器在php.ini sendmail_path指定。 在Windows上,您需要在SMTP參數中指定它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM