douyoufan7881 2016-06-19 13:48
浏览 11

使用PHP,codeigniter在HTML中发送正文文本

I have a dynamic data stored in variable, I want to send the dynamic data in email as body text. when i am trying to send the data through mail,it is sending in one line. I want to send data as it is I written.I want to send with spaces and with new lines.

i got this output:

 Dear chandra, This is to Confirm your inperson Interview on 2016-06-19 00:00:00. Below Mentioned are the venue and contact details for your Convenience. please fill feedback form after completed Interview See below links
ThanksShiva,HR   


i need as below format :


     Dear chandra,
               This is to Confirm your inperson Interview on 2016-06-19 00:00:00. Below Mentioned are the venue and contact details for your Convenience.
     Thanks
     shiva,
     HR



$messageinterviewer = $this->input->post('messageinterviewer');// i get data
$feedbackurl = $this->input->post('feedbackurl');


    $messagewithfeedbackurl = $messageinterviewer;
    $messagewithfeedbackurl .= $feedbackurl;

$this->sendMailToInterviewer ($tointerviewer,$frominterviewer,$ccinterviewer,$subjectinterviewer,$messagewithfeedbackurl);

  • 写回答

1条回答 默认 最新

  • dongwu5318 2016-06-19 14:29
    关注

    First of all please format your question in a better way as it is hard to understand in this way. Leaving that aside you can use PHPMailer with CI and send HTML emails in the following way:

        $mail->isHTML(true);
    
        $mail->Body = '
            <html>
            <head>
                <title>..your title..</title>
            </head>
            <body>
            <h3>..message heading..</h3>
            <p>Dear Receiver_Name,</p><br>
            <p>..message body.. </p><br><br>
            <p>Thanks</p>
            <p>..sender_name..</p>
            </body>
            </html>
        ';
    
    评论

报告相同问题?

悬赏问题

  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?