Bana mı yoksa System.Net.Mail'de MailAddress sınıfında bir hata mı var?İçinde tire olan bir adrese nasıl bir e-posta gönderirim?
Bu kod her zaman excpetion atacağım:
MailMessage mail = new MailMessage();
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
mail.Subject = "Test email"
mail.IsBodyHtml = true;
mail.Body = "<b>Does not work</b>";
//Connect to server and send message.
SmtpClient smtp = new SmtpClient();
smtp.Host = "mailserver.me.com";
smtp.Send(mail);
alıyorum istisna şudur:
System.FormatException: The specified string is not in the form required for an
e-mail address.
Ancak wiki göre, bir çizgi yerel bölümünde geçerli bir karakterdir.
Herkes e-posta adresinde bir çizgi ile birisine e-posta göndermek için System.Net.Mail sınıflarını kullanmanın bir yolunu biliyor mu?
Bu bir kodlama sorunu mu? –
@Mitch Wheat: iyi yorum. "Bunu başka birisini tekrarlayabilir mi?" Diye düşünüyordum. –