代码之家  ›  专栏  ›  技术社区  ›  Hilmi

通过smtp发送邮件会为邮件内容添加新的行

  •  1
  • Hilmi  · 技术社区  · 11 年前

    我们过去使用自己的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 回复  |  直到 11 年前
        1
  •  0
  •   Community CDub    7 年前

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

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

    我必须用base64编码csv内容,并添加 content-transfer-encoding: base64 头球