问题描述:

Using outlook API, am able to send email without setting any sender's email Id.

Heres my C# code:

Outlook.Application oApp = new Outlook.Application();

Outlook.MailItem email = (Outlook.MailItem)(oApp.CreateItem(Outlook.OlItemType.olMailItem));

email.Recipients.Add("[email protected]");

//email.Sender.Address = "[email protected]";

email.Subject = "TestSubject";

email.Body = "TestBody";

((Outlook.MailItem)email).Send();

If I want to send this mail using a different email Id, say [email protected], what do I need to do?

Do I need to use email.Sender.Address = "[email protected]";?

Please advise.

Thanks.

相关阅读:
Top