Comments and Discussions
|
|
Thank you Rob, I tried several solutions but none worked, until I stumbled onto your answer. By the way, where did you find this solution?
|
|
|
|
|
For attachment to work, escape the double quote as below. this code is in C#
MsgBuilder.Append("&Attach=\"c:\\mailattach.txt\"")
Also instead for using System.Diagnostics.Process class, there is a simpler and faster way to open default mail client. code below.
Help.ShowHelp (this, MsgBuilder.TosString ());
here paramaeter 'this' represents a Widows Control (Form, textbox etc.).
Regards,
Srinivasan R
|
|
|
|
|
Thanks for this example of code.
Now I just tried this, but for the Lotus Notes mail client
it doesn't start with attachment txt-file.
Do you have any ideas, what I can change?
Thanks!
Kind Regards
Daniel
|
|
|
|
|
Hi Everybody !
The above example code has an error in the line of the attachment command:
MsgBuilder.Append("&Attach="c:\mailattach.txt")
To get the attachments working, you need a full line like:
mailto:melroy@testmail.com&cc=testcc@testcc.com,testcc1@testcc.com&bcc=testcc@testbcc.com,testcc1@testbcc.com&subject=this is test subject&body=this is test body&Attach="c:\mailattach.txt"
In the example the (") are not set correct. To fill that character (") into a string, use strings.chr(34).
So the right line must be:
MsgBuilder.Append("&Attach=" & Strings.Chr(34) & "c:\mailattach.txt" & Strings.Chr(34))
nice day,
Martin Wolff.
Don't talk about...do the coding.
|
|
|
|
|
Hey, what does that translate to in C#?
|
|
|
|
|
I used your code but still the attachment is not getting into email. Any ideas please
|
|
|
|
|
You can use this way (It's work fine)
System.Diagnostics.ProcessStartInfo psInfo =newSystem.Diagnostics.ProcessStartInfo();
psInfo.Arguments = @"G:\Wi.zip";
psInfo.FileName = @"C:\Program Files\Microsoft Office2003\OFFICE11\OUTLOOK.EXE";
System.Diagnostics.Process.Start(psInfo);
Enjoy
fferdinan
|
|
|
|
|
Hi,
I am invoking my mail client using following piece of code. The code opens the mail client having a subject and a file attached with it.
String strLicensePath = "c:\\rohit.txt";
try {
Runtime.getRuntime().exec(
new String[] {"rundll32", "url.dll,FileProtocolHandler",
"mailto:" + "&subject=" + "TEST_STRING" +
"&attachment=" + "\""+ strLicensePath + "\""}
);
}
catch (Exception ex) {
ex.printStackTrace();
}
The above code works fine on my machine having "Microsoft Outlook 2000 SP-3" installed. But gives following error on machine having
Microsoft Outlook 2002 installed:
"The command line argument is not valid. Verify the switch you are using."
Also, the problem is coming in some of other machines also.
Am I using wrong switches, i.e. arguments??
Or is there any alternative way to achieve the same. Please comment.
|
|
|
|
|
to get it works.
MsgBuilder.Append("&Attach=" & Chr(34) & Chr(34) & Application.StartupPath & "\Data.LHP" & Chr(34) & Chr(34))
simply put 2 double quote.
|
|
|
|
|
Mailto protocol does not support attachments.
See: http://ftp.isi.edu/in-notes/rfc2368.txt
|
|
|
|
|
This feature is seen on pdf documents and they do it very beautifully for all the three default email clients (a) Microsoft Outlook (b) Outlook Express (c) Hotmail. I wish to replicate the same feature in my application.
Regards
-Tej
|
|
|
|
|
if got solution plz fwd me
|
|
|
|
|
|
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.