![]() #Microseven password has invalid character smtp codeWhen I looked at the code there was this line :Ī = uxd_SendFilePath_FileUpload.FileName "An invalid character was found in the mail header." I had similar problem, it is all Encoding, when I tried to attach files with names including French characters. Is the problem even with encoding? Can the SmtpClient handle different encodings? I don't quite understand the intricaces of encoding, could someone help me out? What encoding should I use? How can I determine what encoding I need to use? Well I tried ASCII, default, and UTF-8 and none of them worked. I thought that if I specified a NameEncoding other than null that it would fix things. ![]() The attachment object details are as followsīase Name: "BonjourÉliane.pdf" Create objectĪttachment attachment = new Attachment(contentStream, attachmentInfo.FileName, attachmentInfo.ContentType) System.IO.Stream contentStream = new System.IO.MemoryStream(attachmentInfo.Attachment) IssueAttachmentInfo attachmentInfo = IssueAttachment.GetIssueAttachmentById(Convert.ToInt32(liAttachment.Value)) Create the attachment business object Here's the code pertaining to the attachment: The attachment name has an accented character in it. I am trying to send an email with an attachment. I am having this problem right now and it appears to be an encoding issue. Send(MailMessage message) +2074 .(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, StringĭefaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +341 .() +571 .(WizardNavigationEventArgsĮ) +105 .(Object source, EventArgs e) +453 .(Object source, EventArgs e) +149 .(Object source, EventArgsĪrgs) +17 .Control.RaiseBubbleEvent(Object source, EventArgs args) +35 .(CommandEventArgs e) +115 .(String eventArgument) +171 .UI.IPostBackEventHandler.RaisePostBackEvent(StringĮventArgument) +7 .Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 .Page.RaisePostBackEvent(NameValueCollection postData) +33 .Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,īoolean includeStagesAfterAsyncPoint) +5102 Host, Int32 port) +835 .GetConnection(String host, Int32 port) +316 .GetConnection() +42 .Send(MailMessage message) +1485 (String value, Int32 offset, Int32 count) +915954 .PrepareCommand(SmtpConnection conn, String domain) +106 .GetConnection(String I even tried to set the subject in event handler for "emailsending" event. ![]() So I configured SMTP, then in properties of the wizard indicated textfile for message and wrote simple subject "registration" I wanted to make an automatic email when I create user by CreateUserWizard. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |