473,785 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open default e-mail client with attachments.

Hi,

I'm working on a project based in Windows Forms, and I need to open
the user's default e-mail client (a new e-mail) with some attachments
ready to send. Since the destination of the e-mail is unknow at this
point I can't send it using the SmtpMail.Send() method. And because of
the attachments I'm not able to open the new e-mail using the
"mailto:" technique.

Is there any other way to solve this problem keeping in mind that the
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco
Nov 16 '05 #1
3 18253
Gama,

Why not query the user the address they want to send it to, and then use
the SmtpMail class?

If the email applications support MAPI, then you can probably access any
of them through that interface. However, it might require a good deal of
calls through either COM interop on your part, or the P/Invoke layer to
access the API.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Gama Franco" <Ga*********@cl ix.pt> wrote in message
news:79******** *************** **@posting.goog le.com...
Hi,

I'm working on a project based in Windows Forms, and I need to open
the user's default e-mail client (a new e-mail) with some attachments
ready to send. Since the destination of the e-mail is unknow at this
point I can't send it using the SmtpMail.Send() method. And because of
the attachments I'm not able to open the new e-mail using the
"mailto:" technique.

Is there any other way to solve this problem keeping in mind that the
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco

Nov 16 '05 #2
Hi Nicholas,

Thank you very much for the tip.

I've developed the code and my application can already open the
Outlook window with the attachment on it. The stupid thing is that, in
order to send the e-mail I need to press the Alt+s keys, since the
send button does nothing.

I'm using Outlook 2003, is it a bug or am I missing something?

Best regards,
Gama Franco

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:<uJ******* ******@TK2MSFTN GP15.phx.gbl>.. .
Gama,

Why not query the user the address they want to send it to, and then use
the SmtpMail class?

If the email applications support MAPI, then you can probably access any
of them through that interface. However, it might require a good deal of
calls through either COM interop on your part, or the P/Invoke layer to
access the API.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Gama Franco" <Ga*********@cl ix.pt> wrote in message
news:79******** *************** **@posting.goog le.com...
Hi,

I'm working on a project based in Windows Forms, and I need to open
the user's default e-mail client (a new e-mail) with some attachments
ready to send. Since the destination of the e-mail is unknow at this
point I can't send it using the SmtpMail.Send() method. And because of
the attachments I'm not able to open the new e-mail using the
"mailto:" technique.

Is there any other way to solve this problem keeping in mind that the
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco

Nov 16 '05 #3
hi gama i was trying below code. it works fine. i was trying to attach
files but it is not attached. so if any suggestion then pls reply me on
my below email address.
thanks in advance
john
my email address = te*********@red iffmail.com

----------------------------code----------------------------
Mystring.Append ("mailto:");
Mystring.Append ("&Subject=Fina nce profit and loss&body=this is test
body");
Mystring.Append ("&attach=c:\\t est\\test.txt") ;
Process myProcess = new Process();
myProcess.Start Info.FileName = Mystring.ToStri ng();
myProcess.Start Info.UseShellEx ecute = true;
myProcess.Start Info.RedirectSt andardOutput=fa lse;
myProcess.Start ();
myProcess.Dispo se();
*/

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6085
by: Jofio | last post by:
Hello, I am a newbie in PHP and I am enthusiastically trying out things. I've just replaced my index.html ( file with index.php
1
2218
by: Gregor Leban | last post by:
Hi, Our team is working on a data mining software written in python that will run on windows, linux and mac platforms. When clicking on one of the menu items, we would like to open the default web browser for that platform with a specific html page. Is there any python function that can do that? Thanks, Gregor
9
2076
by: Yann.K | last post by:
Hello. I would like to do a hypertext link on a GUI, which launch a per default mail user agent (with the "to" header documented). To launch an url in a web browser i use webbrowser.open(url). Do exist an equivalent command to run the per default MUA (like ie webbrowser.mail_open(toto@example.com)? Thank's for your help.
18
7844
by: Dan Cernat | last post by:
Hi there, A few threads I had a little chat about default values. I am starting this thread because I want to hear more opinions about the default values of function parameters. Some say they see no use of them. Others say thar they are bad. I like them. So, could anyone tell me why they are in the standard? Are they bad? I do not intend to start war. Nor am I a troll.
8
3046
by: cody | last post by:
Why doesn't C# allow default parameters for methods? An argument against I hear often is that the default parameters would have to be hardbaken into the assembly, but why? The Jit can take care of this, if the code is jitted the "push xyz" instructions of the actual default values can be inserted. To make things simpler and better readable I'd make all default parameters named parameters so that you can decide for yourself why one to...
1
6591
by: mark2802 | last post by:
Im using the CommonDialog activeX control to select multiple file names. However I would like to be able to control using code the resulting view of the files as you can do in realtime using the view menu, ie details, thumbnails, icons etc. I've tried changing the default view in windowsXP for that folder but the resulting view always defaults to thumbnails. I'd also like to be able to control the order of the filenames in the dialog as...
4
13333
by: ceolino | last post by:
Hi all, how can I use menu object to open a new window instead of postback to the same page where the menu is? What I'd like to do is like invoking "window.open()" (javascript) from a menu item. Thanks in advance
8
7846
by: T. Crane | last post by:
Hi, How is the default path chosen in this instance: myFile = file('test.txt','w') Here I'm opening/creating a file but I have not specified the exact path, so how does Python determine where to 'put' this file? More to the point, how do I change what the default path is? Right now it's a networked drive that should not be getting my Python clutter.
0
1085
by: namrataa | last post by:
Cannot Open default database. Invalid login for \ -------------------------------------------------------------------------------- Hi, I have written services in WCF using C# and SQL Server 2005 which comes inbuilt with VS2008 and hosted using IIS. the service is to check for valid user and register new user. The problem is that the application works properly. But when I want to check the database in the server explorer I get error...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.