|
-
Sep 11th, 2002, 11:49 PM
#1
Thread Starter
Hyperactive Member
Outllook and VC#
On Click of a button I need to open an Outlook mail box with an email id in the To and with a specifc message typed in and with a file attached ( specified by the user in a txtbox on a form) ?
-
Sep 13th, 2002, 12:13 AM
#2
Lively Member
=) System.Diagnostics.Process.Start("mailto:[email protected]");
-
Sep 13th, 2002, 12:46 AM
#3
Thread Starter
Hyperactive Member
Thanks
Thanks for that.
How about attaching files?
-
Sep 14th, 2002, 04:58 PM
#4
Lively Member
Well...if your sending e-mails try the System.Mail class..you have to add a refrence to it. Or make your own mail sender, or you can check Microsoft.com for how to use outlook through a command line..
-toto
-
Sep 17th, 2002, 01:00 AM
#5
Thread Starter
Hyperactive Member
Here is the working code:
Outlook.Application oApp=new Outlook.Application();
Outlook._NameSpace oNameSpace=oApp.GetNamespace("MAPI");
oNameSpace.Logon("",null,false,false);
Outlook._MailItem om = (Outlook._MailItem)
oApp.CreateItem(Outlook.OlItemType.olMailItem);
om.Attachments.Add("C:\\ivan.txt",1,1,"Ivan");
om.To = "[email protected]";
om.Subject = "VC# is Great";
om.Body="dfgfdgf";
om.Display(false);
Uses Microsoft Outlook lib
Thanks toto for the help extended.
-
Sep 17th, 2002, 06:41 AM
#6
Fanatic Member
Thanks! You just saved me a bunch of work.
Brian
(Fighting with the RightToLeft bugs in VS 2005)
-
Nov 28th, 2003, 07:25 AM
#7
Lively Member
Hi
i could not add a reference to outlook.. i added microsoft outlook library 10.0.. but still it underlines during compilation..
pls help
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|