我在 codeigniter 中使用 PhpMailer 库发送电子邮件,电子邮件发送过程工作正常,我使用 summernote 编写我的电子邮件内容,summernote 生成我在 summernote 中编辑的 HTML 格式,但是当我发送电子邮件时,收到的邮件只有纯文本,我不知道为什么会这样..在这里我附加了 PhpMailer 函数,function send_email_common_method($email_id,$password,$to,$subject,$content,$attach_file,$ccmailarray,$bccmailarray,$email_id_name) { include_once(APPPATH."third_party/PHPMailer/PHPMailerAutoload.php"); $mail = new PHPMailer; $mail->IsHTML(true); $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->Port = 465;//587 $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = $email_id; $mail->Password = $password; $mail->setFrom($email_id, $email_id_name); $mail->addAddress($to); $mail->Subject = $subject; $mail->msgHTML(strip_tags($content)); $mail->addAttachment($attach_file); foreach($ccmailarray as $ccarray) { $mail->AddCC($ccarray); } foreach($bccmailarray as $bccarray) { $mail->AddBCC($bccarray); } //print_r($mail);exit; if (!$mail->send()) { $error = "Mailer Error: " . $mail->ErrorInfo; return 0; //echo '<p id="para">'.$error.'</p>';exit; } else { return 1; }}下面我附上了 summernote 查看代码,<!--Wysiwyg editor : Summernote placeholder--><textarea name="reply_content_email" class="reply_content_email" id ="reply-mailbox-mail-compose"></textarea><p class="text-danger" id="reply_content_email_err"></p><!-- <div ></div> --><div class="pad-ver"> <!--Send button--> <button id="mail-send-btn" type="submit" name="btn_submit" class="btn btn-primary"> <i class="mailbox-psi-mail-send icon-lg icon-fw"></i> Reply Mail </button></div>任何人都可以找到解决这个问题的方法吗?
- 2 回答
- 0 关注
- 195 浏览
添加回答
举报
0/150
提交
取消