通过smtp发送邮件会在电子邮件内容中添加新行

时间:2014-04-06 11:53:29

标签: email smtp sendmail sendgrid mailer

我们过去常常使用自己的SMTP服务器来发送电子邮件,最近我们开始迁移部分电子邮件以通过SendGrid发送,除了电子邮件的内容被打入新内容之外,一切都顺利进行一定程度后的行

请查看此电子邮件中包含的内容

--BAYT_2660.59000399_BAYT
Content-type: application/octet-stream
Content-Disposition:attachment; filename="CV_report.xls"

date created,CV ID,First Name,Middle Name,Last Name,User Name,,home
 phone,work phone,Mobile Phone,Email Address,Nationality,Country,City,P. O.
 Box,Address (Line 1),Address (Line 2),Gender,Residence Location,Notice
 Period,Last Monthly Salary,Education Degree,Education Location,educational
 institution,completion date of education,education description,work
 experience from date,work experience to date,work experience job
 title,work experience company name,work experience description,work
 experience location,work experience job role,work experience company
 industry,skill name,skill level,skills years of experience,skills last
 used,language name,language level
2008-06-17,3959854,t12345,mars,t12345,t12345,1986-11-11,12-12-12,12-12-12,12-12-12,test_xx@bayt.net,Bahrain,Belgium,,,,,,Belgium,Immediately,0,High
 school or equivalent,,,,,,,,,,,Technology/IT,Information Technology,,,,,,

这是来自旧的smtp服务器。

--BAYT_-142109.046263_BAYT
Content-type: application/octet-stream
Content-Disposition:attachment; filename="CV_report.xls"

date created,CV ID,First Name,Middle Name,Last Name,User Name,,home phone,work phone,Mobile Phone,Email Address,Nationality,Country,City,P. O. Box,Address (Line 1),Address (Line 2),Gender,Residence Location,Notice Period,Last Monthly Salary,Education Degree,Education Location,educational institution,completion date of education,education description,work experience from date,work experience to date,work experience job title,work experience company name,work experience description,work experience location,work experience job role,work experience company industry,skill name,skill level,skills years of experience,skills last used,language name,language level
2008-06-17,3959854,t12345,mars,t12345,t12345,1986-11-11,12-12-12,12-12-12,12-12-12,test_xx@bayt.net,Bahrain,Belgium,,,,,,Belgium,Immediately,0,High school or equivalent,,,,,,,,,,,Technology/IT,Information Technology,,,,,,
如果电子邮件包含csv文件作为附件,如我所显示的图像,那么换行符会产生巨大的影响,"家庭电话"是使用Sendgrid SMTP服务器分成两行的单个值,是否有任何关于导致换行的想法或提示?

1 个答案:

答案 0 :(得分:0)

在这个问题中找到我的答案

How to send a csv attachment with lines longer than 990 characters

我必须用base64编码csv内容并添加content-transfer-encoding: base64标题