用我的Outlook帐户发送邮件 [英] Send mail using My Outlook Account

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

问题描述

我试图用我的Outlook帐户发送邮件形式C#,但我不希望通知弹出窗口尝试发送邮件时要出现了。



任何?主意禁用通知窗口



下面我的代码snippent:

 公共静态无效SendEmail(字符串_ToEmail,串_Subject,串_EmailBody)
{
Microsoft.Office.Interop.Outlook.Application oApp =新Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem电子邮件=(Microsoft.Office.Interop.Outlook.MailItem)(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem));
email.Recipients.Add(_ToEmail);
email.Subject = _Subject;
email.Body = _EmailBody;
((Microsoft.Office.Interop.Outlook.MailItem)电子邮件)。发送();
}


解决方案

弹出you're眼见后市是一个安全功能。避免它的唯一机会,是Outlook本身禁用此功能。如果你真的认为这是去你的方式,尝试谷歌像禁用Outlook安全警告,或检查此线程
如何避免Outlook安全警报从C#程序读取Outlook邮件时这应该指向你的正确的方向。


I tried to send mail form C# using my outlook account but I don't want the notification pop up window to be appeared when trying to send mails.

Any idea to disable the notifications windows?

Here my code snippent:

 public static void SendEmail(string _ToEmail, string _Subject, string _EmailBody)
    {       
        Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); 
        Microsoft.Office.Interop.Outlook.MailItem email = (Microsoft.Office.Interop.Outlook.MailItem)(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem));
        email.Recipients.Add(_ToEmail);         
        email.Subject = _Subject;                      
        email.Body = _EmailBody;         
        ((Microsoft.Office.Interop.Outlook.MailItem)email).Send(); 
    }

解决方案

The popup you´re seeing is a security feature of outlook. The only chance to avoid it, is to disable this feature in outlook itself. If you really think this is the way to go for you, try to google something like "disable outlook security warning", or check this thread How to avoid Outlook security alert when reading outlook message from C# program this should point you to the right direction.

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

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