我们是否可以通过编程方式(使用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;
}
}