duan4739 2015-10-21 11:04
浏览 19

通过switmailor在移动浏览器中获取HTML标记

We have made a form and we are sending its data on email using swiftmailor library.

If user fill data from desktop browser than the data is shown in correct format without HTML tags but if user fill data from mobile browser than htMl tags are coming in email .

Can you suggest if it is problem of mobile browser or swiftmailor.

We are using header :

$headers = "From: " . 'XYZ' . "
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/html; charset=ISO-8859-1
";

and sending mail by swiftmailor

$message = Swift_Message::newInstance('Enquiry FORM')
->setFrom(array('noreply@XYZ.com' => 'XYZ'))   
->setTo(array($sendTo))
->setBody($messageContent, 'text/html')  ;

  // Send the message
   $result = $mailer->send($message);

Please suggest what solution should be implemented so that both browser can send html format.

  • 写回答

1条回答 默认 最新

  • doujiao3016 2015-10-21 11:15
    关注

    Use this

    setBody($this->renderView($messageContent), 'text/html');
    

    instead of this

    setBody($messageContent, 'text/html')  ;
    
    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示