Trying to get a windows form to email

  • Thread starter Thread starter Don Stevic
  • Start date Start date
D

Don Stevic

Hey there

I have beentrying to get a windows form to send an email thru outlook
and cannot find the right code. Does anyone know how to do this?

Thanks
 
Don,

You will have to set a reference to the Microsoft Outlook Object Library
and the Microsoft Office Object Library on the COM when you select "Add
References". This will allow you to access the outlook object model.

However, when you do this, you will probably get security dialogs
whenever you try and do anything, because of Outlook's security model.

Hope this helps.
 
Hello

How can i override attachment process by assinging path of file from my
C# form and attaching it to currently opened mail item,and set the
subject field from my open form

right now it`s setting Subject field value in all opened Mail Windows
here is thecode i am trying.

private Ol.MailItem mailItem=null;

private void button1_Click(object sender, System.EventArgs e)
{

this.mailItem=(Ol.MailItem)myInspector.CurrentItem;
this.mailItem.Subject="mySubj";
//MessageBox.Show(mailItem.Subject.ToString(),"Button");

}

Thanks

-adnan
 
Back
Top