![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
hi
i want to lanuch outlook(default mail client) with an attachment i am able to lanuch outlook with all except attachment like bellow string strAttach = "C:\\test.txt"; string mailto = string.Format("mailto:{0}?Subject={1}&Body={2} &Attach={3}", "", "Test Mail", "Hema", strAttach); //System.Diagnostics.Process.Start(mailto); Process myProcess = new Process(); myProcess.StartInfo.FileName = mailto.ToString(); myProcess.StartInfo.UseShellExecute = true; myProcess.StartInfo.RedirectStandardOutput = false; myProcess.Start(); myProcess.Dispose(); but attachment is not coming pelase help me -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/201001/1 |
Ads |
#2
|
|||
|
|||
![]()
Some combinations of startup switches don't work together. You can test that
in the UI by starting Outlook using those switches. In any case you are better off starting an Outlook session and using the CreateItem() method to create the email and then you can use the object model to set subject, attachments, recipients, etc. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "hemaneelagiri via OfficeKB.com" u54138@uwe wrote in message news:a1b334b725694@uwe... hi i want to lanuch outlook(default mail client) with an attachment i am able to lanuch outlook with all except attachment like bellow string strAttach = "C:\\test.txt"; string mailto = string.Format("mailto:{0}?Subject={1}&Body={2} &Attach={3}", "", "Test Mail", "Hema", strAttach); //System.Diagnostics.Process.Start(mailto); Process myProcess = new Process(); myProcess.StartInfo.FileName = mailto.ToString(); myProcess.StartInfo.UseShellExecute = true; myProcess.StartInfo.RedirectStandardOutput = false; myProcess.Start(); myProcess.Dispose(); but attachment is not coming pelase help me -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/201001/1 |
#3
|
|||
|
|||
![]()
Thanks for your response
you mean to say Crete item. i am able to create item.. but how can we launch that created mail please see below code Outlook._Application oApp = new Outlook.Application(); Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); oNS.Logon(Missing.Value, Missing.Value, false, true); Outlook._MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemTy pe. olMailItem); oMsg.Subject = strSubject; oMsg.Body = strMessage; fi = new System.IO.FileInfo(arrAttachPaths[i]); iPosition = (int)oMsg.Body.Length + 1; oMsg.Attachments.Add(fi.FullName, iAttachType, iPosition, fi.Name); oMsg.To = strToIds; // use rshoukldenetr the To Id // send mail.. but here new mail should launch and user will enetr that to email id oMsg.Send(); oNS.Logoff(); oMsg = null; oNS = null; oApp = null; please help me Ken Slovak - [MVP - Outlook] wrote: Some combinations of startup switches don't work together. You can test that in the UI by starting Outlook using those switches. In any case you are better off starting an Outlook session and using the CreateItem() method to create the email and then you can use the object model to set subject, attachments, recipients, etc. hi i want to lanuch outlook(default mail client) with an attachment [quoted text clipped - 15 lines] pelase help me -- Message posted via http://www.officekb.com |
#4
|
|||
|
|||
![]()
Thanks i got the solution
oMsg.Display(false); hemaneelagiri wrote:[i] Thanks for your response you mean to say Crete item. i am able to create item.. but how can we launch that created mail please see below code Outlook._Application oApp = new Outlook.Application(); Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); oNS.Logon(Missing.Value, Missing.Value, false, true); Outlook._MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemTy pe. olMailItem); oMsg.Subject = strSubject; oMsg.Body = strMessage; fi = new System.IO.FileInfo(arrAttachPaths); iPosition = (int)oMsg.Body.Length + 1; oMsg.Attachments.Add(fi.FullName, iAttachType, iPosition, fi.Name); oMsg.To = strToIds; // use rshoukldenetr the To Id // send mail.. but here new mail should launch and user will enetr that to email id oMsg.Send(); oNS.Logoff(); oMsg = null; oNS = null; oApp = null; please help me Some combinations of startup switches don't work together. You can test that in the UI by starting Outlook using those switches. [quoted text clipped - 8 lines] pelase help me -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possibility to color-code mail folders in Outlook | SaSo | Outlook - Installation | 0 | December 4th 09 01:05 AM |
A code that adds category to an outgoing mail message in outlook | newED | Outlook and VBA | 7 | August 3rd 09 07:50 PM |
Possibility to color-code mail folders in Outlook | glennn.php | Outlook - Installation | 5 | February 15th 09 09:51 AM |
how can I set a pass code to my outlook so only I can open mail | MR.LEE[_2_] | Outlook - General Queries | 1 | December 17th 08 04:14 AM |
Outlook2003 failing to launch after first launch | njmeatball | Outlook - Installation | 4 | October 25th 06 10:29 PM |