Hi, 

I am having issue with email attachment file name. I set File Name of AttachFile action with format "Form_20181204". But the attached file in the actual email is named as "Form 20181204" and the underscore "_" is missing in the file name. Could you please help what causes missing underscore in the file name? Thanks.

Hi Aung,

Try to use the EncodeHTML function. Pass the file name to it and the result as the attachment file name.

Cheers.

Eduardo Jauch wrote:

Hi Aung,

Try to use the EncodeHTML function. Pass the file name to it and the result as the attachment file name.

Cheers.

HI Eduardo, I have tried using EncodeHTML and it still doesn't work.


The issue is only with Attach File component. When I write the File Name in Email body, I can see the underscore properly. Anyone can help?

Hi aung thiha,

That likely has to do with MIME encoding of values... you may want to read some of the links I provided in this post earlier today. You can also read this very informative blog post on the subject.

From what I could find online, a quick fix, working for filenames that use only US-ASCII characters, is to add double quotes around your filename, so you would type in the File Name property of your AttachFile the value: """Form_20181204"""

Jorge Martins wrote:

Hi aung thiha,

That likely has to do with MIME encoding of values... you may want to read some of the links I provided in this post earlier today. You can also read this very informative blog post on the subject.

From what I could find online, a quick fix, working for filenames that use only US-ASCII characters, is to add double quotes around your filename, so you would type in the File Name property of your AttachFile the value: """Form_20181204"""

Hi Jorge, Thanks for your comment. I tried using as suggested, But still no luck. The name shows special characters.



Hi aung thiah,

That seems like the email is actually being sent according to MIME standard (one possibility way of sending filenames is for them to be encoded using one of MIME's accepted encodings: Q-encoding in UTF-8).

Maybe the e-mail client you are using isn't processing it properly? What e-mail application are you using? can you try another e-mail client? This could also be the cause for your attachment to have the wrong name: not because the platform didn't send it correctly, but because the e-mail client reading it isn't following the standards properly.

You may consider enabling logging the contents for the emails you're sending, so you can later analyse what's actually being sent by the platform.

Jorge Martins wrote:

Hi aung thiah,

That seems like the email is actually being sent according to MIME standard (one possibility way of sending filenames is for them to be encoded using one of MIME's accepted encodings: Q-encoding in UTF-8).

Maybe the e-mail client you are using isn't processing it properly? What e-mail application are you using? can you try another e-mail client? This could also be the cause for your attachment to have the wrong name: not because the platform didn't send it correctly, but because the e-mail client reading it isn't following the standards properly.

You may consider enabling logging the contents for the emails you're sending, so you can later analyse what's actually being sent by the platform.

Hi Jorge, 

Thanks again for comment.

I actually have two Outsystems environments with the different version v8 and v10. Both are using same smtp server. i only encounter this issue in v10. I can see the underscore "_" in the email sent from v8. I am not sure if v8 and v10 are using different email clients. 


Hi aung thiha,

The email client is the software you use to read the e-mail that was sent.

But if it works on v8 and doesn't work on v10, seems like an issue with the email sending functionality. I've already flagged this to the team at OutSystems, hopefully they will be able to help you.

Jorge Martins wrote:

Hi aung thiha,

The email client is the software you use to read the e-mail that was sent.

But if it works on v8 and doesn't work on v10, seems like an issue with the email sending functionality. I've already flagged this to the team at OutSystems, hopefully they will be able to help you.


Thanks Jorge. Appreciate your help and looking forward to hearing from them.