TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
b b
NA
53
0
Open Outlook from .Net Application
Sep 17 2010 1:16 AM
Hi All,
I want to open Outlook from my .net application with attachment.
I am using the following codes and its sending mails properly.
But its attaching the file in mail body area instead of attachment field of outlook. I want to attach the file in attachment textbox of outlook. Can anyone help me please.
Outlook.Application oApp = new Outlook.Application();
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("e-mail address");
oRecip.Resolve();
oMsg.Subject = "";
oMsg.Body = "";
String sSource = "C:\\test.txt";
String sDisplayName = "MyFirstAttachment";
int iPosition = (int)oMsg.Body.Length + 1;
int iAttachType = (int)Outlook.OlAttachmentType.olByValue;
Outlook.Attachment oAttach = oMsg.Attachments.Add(sSource, iAttachType, iPosition, sDisplayName);
oMsg.Display(true);
Regards,
B
Reply
Answers (
2
)
GridView Pagie navigation gives Error randomly
Open Outlook Express using .Net Application