0

次のコードを使用して電子メールを送信しようとしています $this->load->library('email', $config);

        $this->email->from('leena.nasir552@gmail.com');
        $this->email->to('leena.nasir@morgan.com');     
        $this->email->subject('my email');     
        $this->email->message($message);

       $result = $this->email->send() ;
       echo($result) ;

        if($this->email->send())

            {

            $params = array (

                'SenderId'=>     $senderId,
                'ReceiverId'=>   $recieverId,
                'Message'=>       $message,
                'Status' =>       'Sent'             // set the statues variable to Sent if it sent successfully

                    );

            $this->UserModel->addMessage($params);

            }  else {
            echo $this->email->print_debugger();

                $params = array (

                    'SenderId' =>     $senderId,
                    'ReceiverId' =>   $recieverId,
                    'Message'=>       $message,
                    'Status' =>       'failed'      // set the status to failed if the message sending failed

                        );

                $this->UserModel->addMessage($params);

                  }

メールを送信しようとするたびにこのエラーが発生する問題

PHP エラーが発生しました

重大度: 通知

メッセージ: 未定義のインデックス: 件名

ファイル名: libraries/Email.php

ライン番号: 982

このエラーの解決を手伝ってくれる人はいますか? これが Email.php ライブラリの 982 行目であることを考えると

$this->_subject = $this->_headers['Subject'];
4

1 に答える 1

2

これらの2行を削除します

 $result = $this->email->send() ;
 echo($result) ;

ここで別の「送信」を使用してメールを2回送信しようとしているため

 if($this->email->send())
于 2012-07-21T13:48:06.210 に答える