开发者

Using Email Class in Codeigniter (Advanced Way)

I want to send emails using Email Class(CodeIgniter) Problem is that Email is sending so simple in text format... I want to design email with (html, tables and colors) or What is the a开发者_Python百科dvanced-way for Emailing with CodeIgniter.


function signup(){

    #stripped out the validation code

    #stripped out the db insert code

    $data = array(
    'some_var_for_view'=>'Some Value for View'
    );

    $htmlMessage =  $this->parser->parse('user/email/signup_html', $data, true);
    $txtMessage = $this->parser->parse('user/email/signup_txt',  $data, true);

    #send the message
    $this->email->from('test@webdevkungfu.com', 'CSSNinja');
    $this->email->to($this->input->post('email_address'));
    $this->email->subject('Account Registration Confirmation');
    $this->email->message($htmlMessage);
    $this->email->alt_message($txtMessage);
    $this->email->send();

}

My problem is now solved with this code found from link below

http://www.webdevkungfu.com/email-templates-with-codeigniter/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜