Know your InterOp 2: Sending email via Outlook
This is a much shorter example of using InterOp. In this case, the requirement was to send an email via Outlook so that the user would have the email in their “sent” folder, as well as receive any “replies” at their address.
Ultimately, I ended up using Exchange services, but here’s my first attempt to fulfill the requirements using InterOp:
Very, very simple. Just drop this class in and call the SendEmail method on it. Note that depending on security setup, the user may see a “warning” message with a skippable countdown. Also note that you really shouldn’t use this for sending more than 1 or 2 messages at a time, especially if that countdown appears, because it will be a very annoying user experience.
If this was my client’s requirement, I would just say "you can’t do that".
And just hope that their intern doesn’t know how to do it.