$subject = "Become a Member of Room";
$message = "Hi Zeeshan";
$message.= "<a href='http://iqra.com.hk/sms/Member/activate/sdskdksn2n23kan92nns29/12'>Clickhere</a>";
$message.= "Room Invite is here";
$message.= "Regards,<br><br>";
$message.= "Demo School";
$this->sendEmail('myemail@gmail.com', $subject, $message,'Demo School');
定义sendEmail()函数
function sendEmail($email,$subject,$message,$school){
$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailtype'] = 'html';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);
$this->email->from('no-reply@example.com',$school);
$this->email->to($email);
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
}
现在我面临的问题是,当我发送电子邮件时,没有收到电子邮件。我跟踪了这个问题,我发现链接中的 http://iqra.com.hk/sms/ 正在创建问题。当我删除时来自
的 http://iqra.com.hk/sms/$message.= "<a href='http://iqra.com.hk/sms/Member/activate/sdskdksn2n23kan92nns29/12'>Clickhere</a>";
并按照这样做
$message.= "<a href='Member/activate/sdskdksn2n23kan92nns29/12'>Clickhere</a>";
然后收到电子邮件。所以我想知道为什么通过在链接中添加我的域名来收到电子邮件?请建议我。