在不使用SMTP的情况下阅读Outlook. [英] Read Outlook without using SMTP.

查看:74
本文介绍了在不使用SMTP的情况下阅读Outlook.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以使我们直接连接到Microsoft Exchange Server,并且无需使用SMTP就可以从Microsoft Office Outlook 14.0编写和发送电子邮件.如果可能,还请提供示例代码.
在此先感谢您.

Is there any way so that we can directly connect to Microsoft Exchange Server and will compose and send Emails from the Microsoft office outlook 14.0 without using SMTP.If possible provide me the sample code also .
Thanks in advance.

推荐答案

是的,您使用的是Exchange Web服务.请参见此处. [
Yes, you use the Exchange Web Services. See here.[^]


public void SendEmail()
        {
            try
            {
                ExchangeService service = new ExchangeService();
                service.AutodiscoverUrl("*****@*****.com");
                EmailMessage message = new EmailMessage(service);
                message.Subject = "Test Email";
                //message.Body = "Test Email body";
                message.Body = "This is an autogenerated Email so please do not reply to this email.This Email is generated to send test email from exchange server.";
                message.ToRecipients.Add("****@*****.com");
               
                message.Save();
                message.SendAndSaveCopy();
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }


这篇关于在不使用SMTP的情况下阅读Outlook.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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