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