Notifications

6 views

Description

Suddenly, a code that used to work to populate BCC or CC fields shows up this kind of output in the Email header, this prevents emails from being sent since no valid emails address was poulated.


    =?UTF-8?Q?Kr=C3=BCger=2C_Julian_=5B055390=5D?= <Julian.Krueger@hdi.global>,
    =?UTF-8?Q?D=C3=B6lle=2C_Walter_=5B049385=5D?= <Walter.Doelle@hdi.de>,
    =?UTF-8?Q?R=C3=BC=C3=9Fel=2C_Marion_=5B027101=5D?= <Marion.Ruessel@hdi.de>,
    =?UTF-8?Q?Naber=2C_J=C3=BCrgen_=5B036214=5D?= <Juergen.Naber@hdi.de>,
    =?UTF-8?Q?Gl=C3=B6ckner=2C_Daniel_=5B010336=5D?=
    

The code used looks uses the getDisplayValue() method with gr referencing a Gliderecord on the table sys_user.

email.addAddress("bcc", gr.email, gr.getDisplayValue());

Release or Environment

Any

Cause

The reason why Emails using BCC or CC are no longer sent and the header shows "=?UTF-8?Q?Kr=C3=B" instead of an email address is because the getDisplayValue() method is unable to handle the UTF8 characters.

That is because the data type of 'blind_copied' of the sys_email table is String and does not support UTF8 characters. 


Resolution


Replace this line of code 

email.addAddress("bcc", gr.email, gr.getDisplayValue());

with this one

email.addAddress("bcc", gr.email);


Article Information

Last Updated:2020-06-30 11:11:38
Published:2020-06-30