0
我試圖向用戶發送一封電子郵件,我用這個代碼:錯誤嘗試發送電子郵件
MailMessage pMail = new MailMessage();
pMail.From = new MailAddress("[email protected]");
pMail.To.Add(new MailAddress(eBox.Text));
pMail.Subject = "Elwazefa Password Reset";
pMail.Body = "Content";
SmtpClient sClient = new SmtpClient();
sClient.Send(pMail);
prError.Text = "An Email with further instructions has been sent to you";
和我收到此錯誤:
The specified string is not in the form required for an e-mail address.
我還配置在SMTP在web.config文件中設置並測試它和它的正常工作
感謝
'eBox.Text'中的值是什麼?最有可能導致問題.... – 2011-05-23 21:14:09