Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » custom mail headers   (RSS)

HOWTO: Set and Get the a multibyte (Japanese, Chinese, Etc) custom header with CDOSYS

Custom headers in multibyte languages (Japanese, Chinese, etc) will not be encoded properly when set using CDO alone. They may appear to be correctly set, however when read back on a recieved message they may be messed-up. Here is an example of a Japanese

Example of setting headers with System.Web.Mail

//============================ Optional Settings ======================== if (this.Priority.Length != 0) { if (this.Priority == "Non Urgent") { oMsg.Priority = System.Web.Mail.MailPriority.Low; }; if (this.Priority == "Normal") { oMsg.Priority = System.Web.Mail.MailPriority.Normal;

Example of setting headers with CDOSYS

//============================ Optional Settings ======================== if (this.Priority.Length != 0) { // Well... it seems that priority is not what needs to be set to get priority set... // Looks like setting importance will set priority... at least

Example of setting headers with System.Net.Mail

Here is a partial sample on setting header fields with System.Net.Mail: //============================ Instance Message =========================== oMsg = new System.Net.Mail.MailMessage(); //============================ Optional Settings ===========================
 
Page view tracker