Send mail from C# using e.g. outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I wood like to be able to setup an email using outlook (or other email
program) from C#, setting up the subject field and write some start text in
the message body.

Normally I would use LaundProcess("mailto:[email protected]"), but this time I do
not know the recipient and I have to fill out the subject and parts of the
body. The user will have to type in the recipient and add som ekstra text to
the message body.
 
Do a search on Outlook Automation (msdn.microsoft.com has some examples).

I just finished a job for a customer of my client that needed this sort of
functionality.

Worked a treat.
 
You have a number of options here. If you want you could use Outlook
automation but this requires that the user of your application has
Outlook... however, have a look at Visual Studio Tools For Office 2.0 (VSTO
2).

Alternatively you could just create a Windows Form that replicates a
standard new email dialog and then the user can fill in the details there,
click on a send button on it, and your application can send it using classes
in the System.Web.Mail namesapce such as SmtpMail, MailMessage, and
MailAttachment.

Hope this Helps

Brian Delahunty
Ireland
 
Back
Top