I have been trying to workaround a non-compliancy issue within version 4.0 of the .NET framework. According to RFC 2047, in the subject line an encoded word can not be longer than 75 characters. If it is, it must be broken up into multiple encoded words separated by CRLF SPACE.
If you use the MailMessage class and try to assign a string with CR or LF, it throws an exception. Internally, it is calling MailBnfHelper.H asCROrLF(value) and if true it throws the exception.
I was hoping to make use of reflection, but can't seem to make it work for me.
Inside of the MailMessage class, the subject line is a private member of type (class) Message. So I would first need to find a way to access this private class. Inside of the Message class, I would need to access the private string "subject". This is the value I would directly need to set so as to avoid the internal Set property.
So far I have had no luck trying to achieve this.
Does anyone have any pointers on how to properly reflect on a setup such as this?
Is this even possible?
Thanks for any help in advance!
If you use the MailMessage class and try to assign a string with CR or LF, it throws an exception. Internally, it is calling MailBnfHelper.H asCROrLF(value) and if true it throws the exception.
I was hoping to make use of reflection, but can't seem to make it work for me.
Inside of the MailMessage class, the subject line is a private member of type (class) Message. So I would first need to find a way to access this private class. Inside of the Message class, I would need to access the private string "subject". This is the value I would directly need to set so as to avoid the internal Set property.
So far I have had no luck trying to achieve this.
Does anyone have any pointers on how to properly reflect on a setup such as this?
Is this even possible?
Thanks for any help in advance!
Comment