1

I have problem in sending email with attachment which file name includes Chinese character by mailman.

The file name of attachment in email looks incorrect. What should I do to make file name display as normal in attachment.

snapshot about attachment with wrong file name

elixir
def compose(reusme_path, resume_name, email, subject, text) do
  %Mailman.Email{
    subject: subject,
    from: "career@xxx.com",
    to: [email], # should be [email] arg
    html: "<html><body>
    <div>#{text}</div>
    <br>
    <br>
    <br>
    <img style='width: 200px; height: 200xp;'
      src='https://cavi-cdn.b0.upaiyun.com/resumes/attachments/rX63jEjNq3Zs7hiQKvDBqY5CBl4peBMT/WechatIMG49.jpeg'/>
    </body></html>",
    attachments: [
      Mailman.Attachment.inline!(reusme_path, "#{subject}.pdf")
    ]
  }
end

So, How to configure mailman Or what should I do to solve this problem. Thanks.

ElliotCui
  • 385
  • 2
  • 9
  • @JustMichael Would you please do me a favor ? Thanks – ElliotCui Jun 15 '17 at 07:59
  • What happens if you remove `URI.encode` and do just `Mailman.Attachment.inline!(reusme_path, "#{subject}.pdf")`? – Dogbert Jun 15 '17 at 08:05
  • @Dogbert If I removed URI.encode, the name of attachment file looks as snapshot shows. May be I should remove URI.encode in question. my mistake. PS: if using URI.encode, all the file name are encoded. but after download, the file name is correct. – ElliotCui Jun 15 '17 at 08:18

0 Answers0