Hello IdM experts,
I'm trying to send an email notification from IdM 7.2 SP7 using JavaScript function uSendSMTPMessage. The email subject line contains German umlauts, e.g. the character 'ü' as part of the word "für". The email is sent without error messages. However, the subject line does not arrive correctly at the email recipient side. For example, character 'ü' is replaced with a pipe character '|'. As a side note: the email body also contains German umlauts; these are transferred without any problems. The issue only exists for the subject line.
I've tried working around this by using different variants of how to specify the actual umlaut in the JavaScript code:
- as a literal character (i.e. var subject = "Genehmigung für ... erforderlich";)
- via Unicode escape sequence (i.e. var subject = "Genehmigung f\u00FC ... erforderlich";)
None of these provided the correct end result after the email had been received. The receiver always gets | instead of ü.
Assuming that this problem is related to character set and codepage, I've tried using the optional parameter SubjectCodePage to the uSendSMTPMessage call, which looks exactly like what I need. According to MSDN, the codepage identifier I would need to specify for Western European encoding (i.e. ISO-8859-1) is "28591".
My problem with that approach, however, is that specifying SubjectCodePage, which is the 15th parameter to uSendSMTPMessage, would require that I specify all 14 parameters before that. That's a problem specifically for parameter number 8, Attachment, because I don't want to send any attachment. I tried supplying the parameter with
- null
- empty string ("")
- undefined
but each of these attempts failed with an exception "uSendSMTPMessage: Cannot read attached file."
Two questions here:
- What's the best approach to deal with non-ASCII characters like German umlauts in email subject?
- if the SubjectCodePage parameter mentioned above is the solution: how do I use it without attachment, or more generally spoken: what value can I supply to the optional parameters to indicate that they're not relevant?
Best regards,
Lambert