Soulshine K

Soulshine K

  • NA
  • 2
  • 8.2k

Programmatically sending email using a different Id

Apr 3 2012 11:01 AM

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?

Please advise.

Thanks.


Answers (1)