1

有什么方法可以在以编程方式(使用 c#)发送 Outlook._MailItem 电子邮件时覆盖发件人电子邮件地址?以下是非工作代码。

        foreach (Outlook.Account account in accounts)
        {
            if (account.SmtpAddress == "me@evilEmpire.com")
            {
                olkMail1.SendUsingAccount = account;

                Outlook.AddressEntry newEntry = null; //Not working.
                newEntry.Address = "miniMe@evilEmpire.com";

                olkMail1.Sender = newEntry;

                ((Outlook._MailItem)olkMail1).Send();

                break;
            }
        }
4

0 回答 0