Daniel Rabinovits

Daniel Rabinovits

  • 2k
  • 34
  • 2.4k

Emailing from C#

Jan 30 2020 11:24 AM
When I email using Outlook.Application:
 
Outlook.Application outlookApp = new Outlook.Application();
Outlook._MailItem email = (Outlook._MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem);
email.Subject = listView2.SelectedItems[0].ToString() + " Your Store Order Reviewed (TESTING)";
email.To = "xxxx.@xxx.xxxx.com";
if (Approved)
{
email.CC = "xxxx@xxx.xxxx.com";
}
email.HTMLBody = emailBody;
email.Send();
I get this annoying security message from Outlook which I have to press send to sent the email.
How can I get around this?

Answers (2)