I'm using Interop for sending e-mails via Outlook, but I am not able to specify the From e-mail address.
I want to send mails to multiple users originating from the same sender (from). I need to mention the from e-mail address. However I cannot find a property using Intellisense that allows me to specify it.
Please help.
Microsoft.Office.Interop.Outlook.Application olkApp1 =
new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem olkMail1 =
(MailItem)olkApp1.CreateItem(OlItemType.olMailItem);
olkMail1.To = txtpsnum.Text;
olkMail1.CC = "";
olkMail1.Subject = "Assignment note";
olkMail1.Body = "Assignment note";
olkMail1.Attachments.Add(AssignNoteFilePath,
Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, 1,
"Assignment_note");
olkMail1.Save();
//olkMail.Send();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…