无法发送电子邮件 [英] unable to send email
本文介绍了无法发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我需要上传文档,并且在文档上传之后,必须将邮件发送到特定的ID.为此,我做了编码.没有错误,文档已升起,但发送邮件部分不起作用.邮件发送部分是这样的
In my application, I need to upload a document and after it is uploaded, a mail haas to be send to a particular id. for this i did the coding. there is no error and the document is uploded but sending mail portion is not working. the mail sending portion is like this
MailMessage message = new MailMessage();
message.From = new MailAddress("from");
message.To.Add("to");
message.Subject = "Test mail";
message.Body = " This is a test ";
message.IsBodyHtml = true;
string smtpUrl = web.Site.WebApplication.OutboundMailServiceInstance.Server.Address;
SmtpClient smtp = new SmtpClient(smtpUrl);
smtp.Send(message);
如果您知道原因,请帮助我.
谢谢
Pls help me if you know the reason.
Thanks
推荐答案
您错过了诸如"POP,SMTP"之类的主要设置,请参阅我的答案 ^ ]
在发布问题之前先在Google/CP中搜索.
谢谢
--RA
Hi,
You have missed major setting like "POP,SMTP" see my answer Here[^]
Search in Google/CP before posting Question.
Thanks
--RA
检查计算机上是否已启用SMTP服务,并确保已在Central Admin中正确配置了该服务.只需导航至Central Admin->系统设置->在电子邮件和文本消息(SMS)"部分下配置传出电子邮件设置.
Check whether SMTP service is enabled on the machine and make sure it''s properly configured in Central Admin. Just navigate to Central Admin --> System Settings --> Configure outgoing e-mail settings under E-Mail and Text Messages (SMS) section.
这篇关于无法发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文