“发送使用”配置值无效
我使用 System.Web.Mail 在我的应用程序中使用以下代码发送电子邮件
;
System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage();
message.From = "[email protected]";
message.To = "[email protected]";
message.Subject = "TestMail";
message.Body = "Test Mail";
message.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer = "smtp.mail.yahoo.com";
System.Web.Mail.SmtpMail.Send(message);
它在我的系统中工作正常,但当我在另一个系统中运行相同的系统时,它在那里不起作用。它显示““SendUsing”配置值无效。”发生错误。我无法继续,请提出一些解决此问题的想法。提前致谢。
The following code i had used to send e-mail in my application,
using System.Web.Mail;
System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage();
message.From = "[email protected]";
message.To = "[email protected]";
message.Subject = "TestMail";
message.Body = "Test Mail";
message.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer = "smtp.mail.yahoo.com";
System.Web.Mail.SmtpMail.Send(message);
It's working properly in my system but when i run the same in another system it doesn't work there. It shows up with 'The "SendUsing" configuration value is invalid.' error occurs. I'm unable to proceed so kindly suggest some idea to solve this. Thanx in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查“其他”计算机的 SMTP 服务器设置。如果此处仅提供代码,则问题很可能是 SMTP 服务器配置不正确。
问候。
Check SMTP server setup for "other" computer. If the only code is presented here, most probabbly the problem is in not correct SMTP serevr configuration.
Regards.