dongzongxun8491 2015-03-25 11:03
浏览 88
已采纳

如何删除html邮件中的随机空格?

I see random spaces in the html mail which breaks entire html structure and gives the weird html mail.

I am using SENDY newsletter API to send mail to clients. The html mail is working fine in all other email clients like outlook express and so on.. except 'ZIMBRA' email client where I see random spaces which is leading to weird html mail.

For Ex: If image path is say http://www.example.com/12.jpg and it gives you

http://ww w.example.com/1 2.jpg

Code

$postdata = http_build_query(
                array(
                    'api_key' => 'xxx',
                    'from_name' => 'xxx',
                    'from_email' => 'xxx',
                    'reply_to' => 'xxx',
                    'subject' => 'Daily',
                    'html_text' => html_content,
                    'list_ids' => 'hhjh',   
                    'send_campaign' => 1
                )
            );   

$opts = array('http' => array('method'  => 'POST', 'header'  => Array('Content: text/html', 'charset=UTF-8'), 'content' => $postdata));

Please help me, Thanks in advance.

  • 写回答

2条回答 默认 最新

  • doujian0265 2015-04-17 11:23
    关注

    I am finally able to find solution for this. I added encode property like this $mail->encoding = base64. It worked.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码