2017-11-16 15 views
1

私はすべてを試したので、この質問に「類似」とマークしないでください。ユーザーが自分のメールに確認メッセージを受け取る登録があります。しかし、私はこの問題を解決することができますどのようにこのCodeigniter3フレームワークがメールにHTMLテンプレートを送信しない

enter image description here

のようなメールを受信しますか?ここで

は私のコードです:

private $config = Array(
     'protocol' => 'smtp',   
     'smtp_host' => 'ssl://mail.wtf.az', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => 'mypasss', 
     'mailtype' => 'html', 
     'charset' => 'utf-8', 
     'wordwrap' => TRUE 
    ); 

function sendEmail($to_email) 
    { 
     $from_email = '[email protected]'; //change this to yours 
     $subject = 'Verify Your Email Address'; 
     $data['link'] = 'https://wtf.az/test/user/verify/<?= md5($to_email); ?>'; 

     $message = $this->load->view('registration/mailing', $data, true); 

     //send mail 
     $this->email->set_header('Content-type', 'text/html'); 
     $this->email->from($from_email, 'WTF'); 
     $this->email->to($to_email); 
     $this->email->subject($subject); 
     $this->email->message($message); 
     $this->email->set_newline("\r\n"); 
     $result = $this->email->send(); 
     return $result; 
    } 
+0

https://www.codeigniter.com/user_guide/libraries/email.html#setting-email-preferences-in-a-config-file - プライベート設定配列はかなり役に立たない... setそれはあなたのconfig/email.phpにあり、この設定が読み込まれます。 – sintakonte

+0

@sintakonteはいいアイデアですか?他のページに別のメールパラメータがあるので –

答えて

0

ます$ this->メール:> set_mailtype( "HTML")を試してみてください。

function sendEmail($to_email) 
{ 
    $from_email = '[email protected]'; //change this to yours 
    $subject = 'Verify Your Email Address'; 
    $data['link'] = 'https://wtf.az/test/user/verify/<?= md5($to_email); ?>'; 

    $message = $this->load->view('registration/mailing', $data, true); 

    //send mail 
    $this->email->set_header('Content-type', 'text/html'); 
    $this->email->from($from_email, 'WTF'); 
    $this->email->to($to_email); 
    $this->email->subject($subject); 
    $this->email->message($message); 
    $this->email->set_newline("\r\n"); 
    $this->email->set_mailtype("html"); 
    $result = $this->email->send(); 
    return $result; 
} 
+0

これを追加すると確認メールがメールに届かない –

関連する問題