发送邮件失败 [英] sending mail failure

查看:103
本文介绍了发送邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MailMessage msg = new MailMessage();
msg.To = txtto.Text;
msg.From = "swarupa.ummalaneni@gmail.com";
msg.Subject = txtsubject .Text;
msg.Body = Output.InnerHtml;

lblmessage.Text = "Sending...";
SmtpMail.SmtpServer = "smtp.yourISP.com";
SmtpMail.Send(msg);
lblmessage.Text = "Sent email (" + txtsubject.Text + ") to " + txtto.Text;


在上面的代码SmtpMail.SmtpServer = "smtp.yourISP.com";中,代替"smtp.yourISP.com",我应该在这里写些什么?有人可以帮我吗?


In above code SmtpMail.SmtpServer = "smtp.yourISP.com"; in place of "smtp.yourISP.com" what should I write here? Can anybody help me?

推荐答案

您需要您的smtp服务器的名称.它通常采用"smtp.yourispname.com"的形式,例如"smtp.sbcglobal.net"或"smtp.roadrunner.com".您可以从ISP的电子邮件帮助网页中获取此信息.
You need the name of your smtp server. It''s usually in the form "smtp.yourispname.com", like "smtp.sbcglobal.net", or "smtp.roadrunner.com". You can get this info from your ISP''s email help web page.


您好
您必须将允许发送消息的服务器的主机名或IP地址放入其中.
例如,如果您使用的是gmail smtp服务器,则可以使用

SmtpMail.SmtpServer ="smtp.gmail.com"

如果您有任何疑问,请告诉我.

谢谢
Hi
You have to put your host name or IP Address of server from where message are allow to fire.
for example if you are using the gmail smtp server then you can use

SmtpMail.SmtpServer="smtp.gmail.com"

Still if you have any query let me know.

Thanks,


哇.如果您不知道如何设置邮件服务器,那么为什么要编写代码.我们无法回答这个问题,因为答案就是您所说的smtp服务器.也许您应该做一门课程,而不是从网络上复制随机代码?
Wow. If you don''t know how to set up a mail server, why are you writing code. We can''t answer this, because the answer is, your smtp server, as it says. Perhaps you should do a course instead of copying random code off the web ?


这篇关于发送邮件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆