【问题标题】:Send email without leaving a copy in the Sent folder outlook c#发送电子邮件而不在已发送文件夹中留下副本 Outlook c#
【发布时间】:2016-11-29 14:59:58
【问题描述】:

当我在 c# 中通过 Outlook 发送邮件时,所有邮件都保存在已发送的框中。有什么方法不会以编程方式将邮件副本留在已发送文件夹中。

【问题讨论】:

    标签: c# outlook-addin exchangewebservices


    【解决方案1】:

    在调用Send之前将MailItem.DeleteAfterSubmit属性设置为true。

    【讨论】:

    • 感谢它有效,但我也通过 Exchange Server 发送邮件。这是一个可选要求。不知道如何通过交换做到这一点
    • MailItem.DeleteAfterSubmit 将在 Exchange 或任何其他传输方式下工作,例如 SMTP。
    • 谢谢.. 但我是通过创建 EmailMessage 的对象来发送的。所以电子邮件消息没有这样的属性。有什么方法可以避免保存已发送的邮件。
    • 什么是EmailMessage? Outlook 对象模型中没有这样的对象。
    • 我这样发送:ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); service.Credentials = new WebCredentials("username", "password", "MYDOMAIN"); service.Url = new Uri("exchangebox/EWS/Exchange.asmx"); EmailMessage em = new EmailMessage(service); em.Subject = "示例电子邮件"; em.Body = new MessageBody("hello world"); em.Sender = new Microsoft .Exchange.WebServices.Data.EmailAddress("john.smith@example.com"); em.ToRecipients.Add(("bob.smith@example.com")); // 发送邮件并放入SentItems : em.Send();
    猜你喜欢
    • 2012-07-10
    • 2014-11-05
    • 1970-01-01
    • 1970-01-01
    • 2014-03-18
    • 1970-01-01
    • 2011-03-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多