从应用程序C#以编程方式将电子邮件发送到Outlook 2010 [英] programmatically send email to outlook 2010 from an application C#

查看:72
本文介绍了从应用程序C#以编程方式将电子邮件发送到Outlook 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以编程方式向c#中的帐户发送电子邮件.它没有错误,但是当我检查收件箱时最终没有收到邮件;

Im trying to send email to an account in c# programmtically.It gives no errors but finally the mail is no received when i check the inbox;

System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                                   mail.To.Add("hari.prasad@fnu.ac.fj");
                                   mail.Subject = "Put a subject here";
                                   mail.From = new System.Net.Mail.MailAddress("hari.prasad@fnu.ac.fj");
                                   mail.Body = "Put your message here";
                                   System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("mail.fnu.local");
                                   smtp.Send(mail);


有关为何无法解决问题的任何想法,或者我需要改进以使其正常工作

谢谢


any ideas as to why is not working out or what do i need to improve to get it working

Thanks

推荐答案

您是否缺少smtp登录信息?
Are you missing the smtp login info?


这篇关于从应用程序C#以编程方式将电子邮件发送到Outlook 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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