工单节点使用指南
• 请用平和的语言准确描述你所遇到的问题
• 厂商的技术支持和你一样也是有喜怒哀乐的普通人类,尊重是相互的
• 如果是关于 V2EX 本身的问题反馈,请使用 反馈 节点
aneureka

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

  •  
  •   aneureka · Apr 20, 2019 via Android · 2866 views
    This topic created in 2585 days ago, the information mentioned may be changed or developed.

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

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

    反正我是这样解决的。
    aneureka
        2
    aneureka  
    OP
       Apr 21, 2019 via Android
    @ninja911 不是的,好像发给所有邮箱都这样…可能是 content-type 的问题吧。。
    aneureka
        3
    aneureka  
    OP
       Apr 21, 2019 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3958 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:13 · PVG 12:13 · LAX 21:13 · JFK 00:13
    ♥ Do have faith in what you're doing.