I personally have not tried, but according to this , you only need:
subject = subject.Replace('\r', ' ').Replace('\n', ' ');
or something similar.
Internally, the MailMessage class will validate the object using:
if (value != null && MailBnfHelper.HasCROrLF(value)) { throw new ArgumentException(SR.GetString(SR.MailSubjectInvalidFormat)); }
Thus, the only limitation (at the moment) is the presence of CR or LF .
Christian.K Aug 30 2018-11-11T00: 00Z
source share