Adding attachments to an email using Exchange Web Services

In a previous article on sending email with Exchange Web Services (EWS) we showed how easy it was to integrate with Exchange and send email. If you’ve ever wanted to attach a file to an email that your sending, it’s super easy (much faster than the System.Net.Mail method):

//Create an email message and identify the Exchange service
EmailMessage message = new EmailMessage(service);

//Attach a file - THE MAGIC
message.Attachments.AddFileAttachment(@"c:\temp\somefile.jpg");

//Send the email message and save a copy
message.SendAndSaveCopy();

That’s it! If you want to see all of the code needed for sending, see Retrieving and Sending Email using Exchange Web Services Managed API 2.0 (c#)

Adding attachments to an email using Exchange Web Services

Update – More Details: Retrieving Email using Exchange Web Services Managed API 2.0 (c#)

email-orange-512x512So maybe you have started to use the Exchange Web Services Managed API to get email from inboxes and wanted to get a few additional details. Below are two of the most popular issues: Continue reading “Update – More Details: Retrieving Email using Exchange Web Services Managed API 2.0 (c#)”

Update – More Details: Retrieving Email using Exchange Web Services Managed API 2.0 (c#)

Retrieving and Sending Email using Exchange Web Services Managed API 2.0 (c#)

exlogoIf you haven’t already had the need, I’m sure you will at some point, to either retrieve email or send email through Exchange (not just relay or connect to Outlook) using .net. Since Microsoft introduced the Microsoft Exchange Web Services Managed API 2.0 this task has become much more efficient No more clunky 2.0 type web service references etc. Below is a complete chuck of code with a few samples. One sample function sends an email, the other retrieves email messages from an inbox with the option of filters.

Continue reading “Retrieving and Sending Email using Exchange Web Services Managed API 2.0 (c#)”

Retrieving and Sending Email using Exchange Web Services Managed API 2.0 (c#)