Email attachment in Japanese

Hi the SMTP emailing is working fine in foreign language, including the subject heading.
I’m now trying to add file attachment. I used a pdf that has Japanese characters as filename.
Was able to email out but the receiving end is receiving a scrambled up ASCII lettering as file name.

How to I encode the file name so that it stays in its original language before sending out?

Use CURL from the MBS plugin or the Chilkat plugin. There is no known workaround.

Check out our CURLEmailMBS class.

from this post :
may be you can try this trick (for the only) :

file.LoadFromFile(GetFolderItem(Attachments.Name(x), FolderItem.PathTypeShell))
fileExtension = NthField(file.Name, ".", 2)
file.MIMEType = "image/jpeg"
file.ContentEncoding = "base64"
file.Name = "=?UTF-8?B?" + EncodeBase64(DefineEncoding(Attachments.Value(Attachments.Name(x)) + "." + fileExtension, Encodings.UTF8)) + "?="

I’ve actually tried something similar…maybe my coding is wrong…?
The result was a file was emailed but the name got changed automatically to realbasic_xojo.pdf and when I tried to read it, it could not be open saying that it was not properly decoded.

mail. …
mail. …

If SelectedFolderItemLabel.Text <> “” Then
Dim file As New EmailAttachment
Dim fileName As String
Dim fileExtension As String

file.LoadFromFile(GetFolderItem(file.Name, FolderItem.PathTypeAbsolute))
fileName = Replace(file.Name, "." + (NthField(file.Name, ".", 2)), "")
fileExtension = NthField(File.Name, ".", 2)
file.MIMEType = "application/pdf"
file.ContentEncoding = "base64"
file.Name =  "=?UTF-8?B?" + EncodeBase64(fileName + "." +  fileExtension, 0) + "?="


end if

Any feedback greatly appreciated.


file.LoadFromFile(GetFolderItem(file.Name , FolderItem.PathTypeAbsolute))


file.LoadFromFile(GetFolderItem(SelectedFolderItemLabel.Text , FolderItem.PathTypeAbsolute))


Works perfectly! Thank you very much!