outlook-addin

How do i specify X-Headers for outgoing emails in Microsoft Outlook 2010

一曲冷凌霜 提交于 2020-01-13 06:15:23
问题 I need to include custom headers in my outgoing emails. I'm using Microsoft Outlook 2010 and SendGrid SMTP server. In particular, i want to specify a unique tracking ID on each mail using SendGrid's X-SMTPAPI header. My Approach: I am build an Outlook Add-In that will intercept outgoing emails and add the required headers Outlook.Application object has an ItemSend event that serves this purpose. How do i use Mail.PropertyAccessor.SetProperty to set the custom headers? I am unable to find the

Programmatically encrypt Outlook email using Inspector

百般思念 提交于 2020-01-11 11:02:50
问题 I'm using C# with Outlook Object Model (Redemption is not an option for me due to licensing) and I'm having difficulty programmatically encrypting an email message before sending it. I can successfully get a reference to the CommandBarButton which supposedly represents the Encrypt button (Id 718 according to online examples), but I cannot programmatically depress it. I tried using both the CommandBarButton Execute() method and using SendKeys (not sure if sendkeys is even valid in this context

How to add images from resources folder as attachment and embed into outlook mail body in C#

非 Y 不嫁゛ 提交于 2020-01-06 21:10:30
问题 I have a couple of images stored in visual studio project Resources folder, and I have to load them and display on the outlook mail body. Here it is the code: Bitmap b = new Bitmap(Properties.Resources.MyImage); ImageConverter ic = new ImageConverter(); Byte[] ba = (Byte[])ic.ConvertTo(b, typeof(Byte[])); MemoryStream logo = new MemoryStream(ba); LinkedResource companyImage = new LinkedResource(logo); companyImage.ContentId = "companyLogo"; mailitem.HTMLBody += "<img src=\"cid:companyLogo\">"

How to add images from resources folder as attachment and embed into outlook mail body in C#

爱⌒轻易说出口 提交于 2020-01-06 21:10:11
问题 I have a couple of images stored in visual studio project Resources folder, and I have to load them and display on the outlook mail body. Here it is the code: Bitmap b = new Bitmap(Properties.Resources.MyImage); ImageConverter ic = new ImageConverter(); Byte[] ba = (Byte[])ic.ConvertTo(b, typeof(Byte[])); MemoryStream logo = new MemoryStream(ba); LinkedResource companyImage = new LinkedResource(logo); companyImage.ContentId = "companyLogo"; mailitem.HTMLBody += "<img src=\"cid:companyLogo\">"

Get the Content-Type of an Outlook MailItem

隐身守侯 提交于 2020-01-06 16:06:20
问题 I'm working on an Outlook VSTO in C#, targeting Outlook 2010. I need to get the MIME Content-Type of a message (think text/plain or its more exotic alternatives). The only place I can find this is in the message headers, which is a long string that I'd prefer not to need to read and parse manually. MSDN documents the PidNameContentType property (alternate link), but I can't get it to work. Anything like that always fails (not found). String ct = mail.PropertyAccessor.GetProperty( "urn:schemas

Get the Content-Type of an Outlook MailItem

六月ゝ 毕业季﹏ 提交于 2020-01-06 16:05:31
问题 I'm working on an Outlook VSTO in C#, targeting Outlook 2010. I need to get the MIME Content-Type of a message (think text/plain or its more exotic alternatives). The only place I can find this is in the message headers, which is a long string that I'd prefer not to need to read and parse manually. MSDN documents the PidNameContentType property (alternate link), but I can't get it to work. Anything like that always fails (not found). String ct = mail.PropertyAccessor.GetProperty( "urn:schemas

Is it possible to distinguish between attachments added with drag and drop and via the attachment menu button

谁说我不能喝 提交于 2020-01-06 08:42:20
问题 I have an outlook add-in that handles email attachments. I have my own ribbon button to add attachments but I would like to catch attachments added via drag and drop while ignoring attachments added using the standard attachment button. It is easy enough to implement a ItemEvents_10_BeforeAttachmentAddEventHandler() but I know of no way to distinguish between attachments added with drag and drop and via the attachment menu button. Is this possible? Is it possible to handle the drag and drop

Office365 - Rest API - Message ItemAttachment loosing headers & attachments when forwarded

拜拜、爱过 提交于 2020-01-06 08:42:06
问题 I'm trying to send the email as an attachment to a user by creating draft message then attaching the #Microsoft.OutlookServices.ItemAttachment using /attachments The Item parameter sent in /attachments API call is the object received from API call made to get-a-message. But when the email is received the ItemAttachment is missing the original email headers and the original email attachment. The attachment is having only the following headers: From: --Removed-- To: --Removed-- Subject: -

Outlook.MailItem.HTMLBody doesn't refresh when updated under inline response

梦想的初衷 提交于 2020-01-06 07:11:55
问题 When setting MailItem.HTMLBody for a inline response, sometimes the updated body never gets displayed. If I make a call to MailItem.Save() , sometimes it shows up but only under saved draft preview. Does anyone know of a way to force the updated HTMLBody to render? Some addition findings: For emails with only plain text (but MailItem.BodyFormat is OlBodyFormat.olFormatHTML ), this always happens. For emails with HTML content and images, this happens if user chooses to download external

Outlook.MailItem.HTMLBody doesn't refresh when updated under inline response

泄露秘密 提交于 2020-01-06 07:11:15
问题 When setting MailItem.HTMLBody for a inline response, sometimes the updated body never gets displayed. If I make a call to MailItem.Save() , sometimes it shows up but only under saved draft preview. Does anyone know of a way to force the updated HTMLBody to render? Some addition findings: For emails with only plain text (but MailItem.BodyFormat is OlBodyFormat.olFormatHTML ), this always happens. For emails with HTML content and images, this happens if user chooses to download external