Email subject - encoding

Ettu_Brute
Member Posts: 8
Hi all
I'm having an issue with special characters in email subject and attachment filenames. I've tried lots of different versions/builds (2017 and up).
I'm using the standard 'Send' action on the Post Sales Invoice card using Email: Yes (Prompt for Settings)
If I put 'æ' in the subject and send using SMTP (un-tick the 'Edit in Outlook') it will show up as 'æ' in the email.
If I put 'æ' in the subject and edit the email in Outlook before sending it, it will work correctly.
I know it's an encoding problem because when it fails the 'æ' has been encoded as =C3=A6 but when it works it has been encoded as =E6 but I have no idea what I can do to fix this.
Interestingly if I put in lots of special characters the entire string is Base64 encoded and everything works fine!
I'm having an issue with special characters in email subject and attachment filenames. I've tried lots of different versions/builds (2017 and up).
I'm using the standard 'Send' action on the Post Sales Invoice card using Email: Yes (Prompt for Settings)
If I put 'æ' in the subject and send using SMTP (un-tick the 'Edit in Outlook') it will show up as 'æ' in the email.
If I put 'æ' in the subject and edit the email in Outlook before sending it, it will work correctly.
I know it's an encoding problem because when it fails the 'æ' has been encoded as =C3=A6 but when it works it has been encoded as =E6 but I have no idea what I can do to fix this.
Interestingly if I put in lots of special characters the entire string is Base64 encoded and everything works fine!
0
Best Answer
-
If whitespaces are ok, it's possible to go into Codeunit 400 SMTP Mail, function CreateMessage and in line:
Mail.Subject := Subject;
Add two UTF16 whitespaces:WhiteSpace := 160; Mail.Subject := Subject + FORMAT(WhiteSpace) + FORMAT(WhiteSpace);
Where WhiteSpace is Char.
At least with us it seemed that if there were 3+ non-UTF8 characters it'll output correctly.5
Answers
-
If whitespaces are ok, it's possible to go into Codeunit 400 SMTP Mail, function CreateMessage and in line:
Mail.Subject := Subject;
Add two UTF16 whitespaces:WhiteSpace := 160; Mail.Subject := Subject + FORMAT(WhiteSpace) + FORMAT(WhiteSpace);
Where WhiteSpace is Char.
At least with us it seemed that if there were 3+ non-UTF8 characters it'll output correctly.5 -
Thanks notificnav.
Whilst this seems to do the trick I really really really don't want to change C400 like this, but as a last resort I'll subscribe to OnBeforeCreateMessage in C400 and do your magic trick. Thanks for your reply.1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions