V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
工单节点使用指南
• 请用平和的语言准确描述你所遇到的问题
• 厂商的技术支持和你一样也是有喜怒哀乐的普通人类,尊重是相互的
• 如果是关于 V2EX 本身的问题反馈,请使用 反馈 节点
aneureka
V2EX  ›  全球工单系统

mailgun 发邮件时会自动忽略点中文名的附件

  •  
  •   aneureka · 2019-04-20 21:36:07 +08:00 via Android · 2116 次点击
    这是一个创建于 1804 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已经给 mailgun 提工单的,不知道大家遇到过这个问题没有…有没有比较好的解决方案。

    3 条回复    2019-04-21 17:37:51 +08:00
    ninja911
        1
    ninja911  
       2019-04-20 23:36:23 +08:00
    我猜你是发给腾讯 QQ 邮箱的吧。不是 Mailgun 的问题。是腾讯的问题。
    当你的单个附件文件名超过 6 个字时(不管中文还是英文),可以尝试附件名称命名
    ```
    $newName = '=?UTF-8?B?'. base64_encode($attachFileName) . '?=';
    ```

    反正我是这样解决的。
    aneureka
        2
    aneureka  
    OP
       2019-04-21 09:28:47 +08:00 via Android
    @ninja911 不是的,好像发给所有邮箱都这样…可能是 content-type 的问题吧。。
    aneureka
        3
    aneureka  
    OP
       2019-04-21 17:37:51 +08:00 via Android
    这个是 Mailgun 给我的回复,貌似他们也遇过这问题然后解决不了…

    Hello xxx,

    Thank you for the update and clarification!

    I first came across this issue a couple of years ago, and unfortunately, I still have not been able to find a solution with Python.

    The issue stems from how Python attempts to handle Unicode and byte strings. Python has been the only language I've struggled with this matter. The only solution would be to use the ASCII equivalent of the filename and submit the data with the POST request.

    Reference: https://stackoverflow.com/questions/20591599/why-arent-post-names-with-unicode-sent-correctly-when-using-multipart-form-data

    I apologize for any inconvenience this may cause. Let us know if you have any questions.

    Thank you,
    Marco@MG
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   955 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:24 · PVG 05:24 · LAX 14:24 · JFK 17:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.