2

I'm using codeigniter email function for sending mail. Here is the code.

 $this->email->to($to);     
 $this->email->subject($subject);
 $this->email->attach($_FILES['attachments']['tmp_name']);
 $this->email->message($mailcontent);
 if($this->email->send())
    {
    return true;
    }

when I printed the content just before sending it like this, I found its fine till there.

$this->email->message($mailcontent);
print_r($mailcontent);exit;
     if($this->email->send())
        {
        return true;
        }

But the mail I'm getting is empty.It has subject but the body is empty. Why is this happening ?

4

2 に答える 2

0

まず、電子メール ライブラリをロードします。

$this->load->library('email');

第二に、メールチェックを送信した直後:

if($this->email->send()){
    echo $this->email->print_debugger();die;
}
于 2013-07-19T07:34:11.827 に答える