c# - Email subject problem -
i using mailmessage class in program. when subject long subject like.
subject:
=?utf-8?b?w0vudgvychjpc2uguhjpb3jpdhldic0gq3vzdg9tzxigsw5jawrlbnqgnjkxnzigzm9yiehhcmlkagfyyw4gkdezmjm5oskgagfyawroyxjhbnjac3luy2z1c2lvbi5jb20goibuzxn0aw5nifrlc3rpbmcgvgvzdgluzybuzxnpbmcgvgvzdgluzybuzxn0aw5nifrlc3rpbmcgvgvzdgluzybuzxn0aw5nifrlc3rpbmcg4o" this problem occurred in server only. while debugging have used same subject content in "local" but, got correct subject.
program:
protected mailmessage msg; msg.subject = subject; got same (error) subject in webmail.ihostexchange.net also.
what problem?
update:
this part of coding.
public emailsenderthread(string emailaddresses, string ccemailaddress, string from, string subject, string body) : base() { msgthread = new thread(new threadstart(mailsender)); this.mailaddress = emailaddresses; this.ccmailaddress = ccemailaddress; msg.from = new mailaddress(from); msg.isbodyhtml = true; msg.body = body; string[] mails = emailaddresses.split(';'); foreach (string mail in mails) if (!string.isnullorempty(mail)) msg.to.add(mail); if (ccemailaddress != string.empty) { string[] ccemails = ccemailaddress.split(';'); foreach (string ccmail in ccemails) if (!string.isnullorempty(ccmail)) msg.cc.add(ccmail); } msg.subject = subject; msgthread.start(); } i have tried
msg.subjectencoding = system.text.encoding.utf8; but got same error. did got doubt. please let me know if didn't explain clearly.
1) why working fine in local? , why not working when hosting server. ?
2) maximum length of subject line?
2) maximum length of subject line?
from rfc822 unstructured header fields:
some field bodies in standard defined "unstructured" (which specified below us-ascii characters, except cr , lf) no further restrictions. these referred unstructured field bodies. semantically, unstructured field bodies treated single line of characters no further processing (except header "folding" , "unfolding" described in section 2.2.3).
the subject line unstructured field, , therefore has no imposed length limit.
Comments
Post a Comment