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

问题描述

在我的应用程序中,我需要上传文档,并且在文档上传之后,必须将邮件发送到特定的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

推荐答案



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

08-06 11:02
查看更多