Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code to trigger the outlook appointments.

Now, the new requirement is to add an inline image in the appointment. I did try in different ways. Due to the trust center settings of the outlook, the image will not be displayed. If the mail is forwarded or replied, the images are visible.

Can someone help me in resolving this?

I tried converting to base64 string, using cid etc., but these works for sending mails, but the same is not working for appointments. I used img tag of html for adding the image in the appointment body.

Thanks in Advance!
Posted
Updated 17-Mar-15 22:42pm
v3

1 solution

XML
LinkedResource inline = new LinkedResource(filePath);
            inline.ContentId = Guid.NewGuid().ToString();
            MailMessage mail = new MailMessage();
            Attachment att = new Attachment(filePath);
            att.ContentDisposition.Inline = true;
            mail.From = from_email;
            mail.To.Add(data.email);
            mail.Subject = "Client: " + data.client_id + " Has Sent You A Screenshot";
            mail.Body = String.Format(
                "<h3>Client: " + data.client_id + " Has Sent You A Screenshot</h3>" +
                @"<img src=""cid:{0}"" />", inline.ContentId);

            mail.IsBodyHtml = true;
            mail.Attachments.Add(att);

 
Share this answer
 
Comments
Reshma Babu 19-Mar-15 2:11am    
This works for mail. But, I need to do the same for appointments.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900