I am trying to send emails with the same logo on it every time but I cannot seem to get any image to appear, the code I have done is as follows:
Outlook.Application oApp = new Outlook.Application();
Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
String attachmentDisplayName = "MyAttachment";
string imageSrc = "C:\\Users\\Test\\Pictures\\image.jfif";
Outlook.Attachment oAttach = oMailItem.Attachments.Add(imageSrc, Outlook.OlAttachmentType.olByValue, null, attachmentDisplayName);
string imageContentid = "someimage.jpg";
oAttach.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E", imageContentid);
oMailItem.HTMLBody = String.Format(
"<body>Hello,<br><br>This is an example of an embedded image:<br><br><img src=\"cid:{0}\"><br><br>Regards,<br>Tarik</body>",
imageContentid);
oMailItem.To = textBox1.Text;
oMailItem.Subject = textBox3.Text;
What am I doing wrong here?