开发者

Problem with SMTP Credentials Password encoding

开发者 https://www.devze.com 2023-03-12 01:45 出处:网络
I\'m having a very difficult and strange problem Authenticating with System.Net.Mail.SMTPClient. I need to auth with a password that contains some special characters, the problematic one being the ch

I'm having a very difficult and strange problem Authenticating with System.Net.Mail.SMTPClient.

I need to auth with a password that contains some special characters, the problematic one being the character '»'. After setting the Credentials property of 开发者_JAVA百科the client like this:

smtpClient.Credentials = new NetworkCredential(selectedSMTPConfig.user_name, pwd);

and being pretty sure the string is correct (i even build the string using raw bytes and Encoding.UTF8.GetChars),i trace the SmtpClient only to see that the Base64 string in the AUTH Login is incorrect and when i decode it, i get an extra 'Â' before the the '»'.

It seems to me that it's some encoding limitation inside SMTPClient and i think i can't do anything about it in my code but i need to fix it so... HELP!


@francis i do not think that you can do it because authentication would have to take place first ... i'm guessing that if you can ensure that the correct characters are in your data stream, then you could be okay. you can use WireShark to check you transmission.

The Guillemet Wikipedia article may prove useful to you.

0

精彩评论

暂无评论...
验证码 换一张
取 消