Problem attaching files programatically to mailItem

J

jbhan

Hi,

I am trying to attach a file to a mail programatically.
But it is showing some strange behavior.
If I send the file to some outside email account (yahoo/
hotmail) the file is sent as an attachment, on the other
hand when I send the same mail back to my outlook
account from the same outlook account the file is not
attached (attachment is also never visible in the mail
copy that is saved in the sent items).

What do I need to keep in mind to add attachments
programatically? What could I be doing wrong? Do I need
to use redemption for this? Following is my sample code..

oMail.Save();

oMail.Attachments.Add
(sTempFile,Outlook.OlAttachmentType.olByValue,0,"Myattachm
ents");

oMail.Save();
oMail.Send();

I am using Outlook 2003 and .NET version 1.1
Any suggestions would be a great help!

Thanks,
jbhan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top