我正在尝试向新注册的用户发送电子邮件,并在该电子邮件中发送带有验证码的链接,如果用户单击此链接,则只会激活他的帐户。
我设法发送电子邮件,但链接只是一个文本,它不是超链接,这是我的代码
$verification_code = "dkeoKUd";
$this->email->from('xyz@xyz.com', 'xyz');
$this->email->to($user_email);
$this->email->subject('Email Test');
$link = 'Click on this link - <a http://localhost/Registration_Demo/update_verification_status/update_code='.$verification_code.'>http://localhost/Registration_Demo/update_verification_status/update_code='.$verification_code.'</a>';
$this->email->message($link);
$this->email->send();
在这个控制器的构造函数中,我写了
$this->load->library('email');
$this->email->set_mailtype("html");