开发者

Codeigniter achor producing dodgy link in email inbox.. what could the problem be?

My application is emailing out fine but the email I receive displays incorrectly. Rather than have text and a simple "click here to activate" link it doesn't. it shows this instead:

开发者_如何学C
Hi user1, please click the following link to activate your account <a
href="http://mysite.com/activation/fzyZuyxVAzZS2koVg5UFjfVjlcLNcrzp">ssss</a>

Here is the code from my model that sends email to user when they request activation email.

   $this->load->library('email');
    $this->email->from('myemaill@gmail.com', 'my site');
    $this->email->to($result[0]->email);
    $this->email->subject('my site - Activate your account');
    $this->email->message('Hi ' . $result[0]->first_name . ', please click the following link to activate your account ' . anchor('http://mysite.com/activation/' . $new_activation_code, 'click here to activate'));
    $this->email->send();

Also the mail always ends up in my spam folder.


The email format is plain text at the moment, you need to convert it to HTML via this option of the email library:

$config['mailtype'] = 'html';
$this->email->initialize($config);

See Docs for more info

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜