473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Invoke Email Client

I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to invoke
whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne
Nov 20 '05 #1
6 3063
www.vbip.com

Wayne Wengert wrote:
I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to invoke
whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne


Nov 20 '05 #2
Hi there.
Try opening a link to mailto:a@b.c;d@e.f&subject=subjec&body=body
In .Net it could be
Process.Start("mailto:a@b.c;d@e.f&subject=subjec&b ody=body")

Does it help?
Andre Nogueira

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to invoke whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne

Nov 20 '05 #3
Works like a charm - thanks

Wayne

"Andre Nogueira" <an**@netcabo.pt.NOSPAM> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...
Hi there.
Try opening a link to mailto:a@b.c;d@e.f&subject=subjec&body=body
In .Net it could be
Process.Start("mailto:a@b.c;d@e.f&subject=subjec&b ody=body")

Does it help?
Andre Nogueira

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to

invoke
whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne


Nov 20 '05 #4
That is an excellent resource - thanks!

Wayne

"Supra" <su*******@rogers.com> wrote in message
news:jE***************@news04.bloor.is.net.cable.r ogers.com...
www.vbip.com

Wayne Wengert wrote:
I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to invoke whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne

Nov 20 '05 #5
* "Wayne Wengert" <wa***************@wengert.com> scripsit:
I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to invoke
whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.


From my FAQ:

Opening the default mail client with a mail template:

Sample based on work by Fergus Cooney and Cor (mpdl.vb), optimized and
extended by Herfried K. Wagner [MVP]:

Add a reference to "System.Web.dll". Then you can use this code:

\\\
Imports System.Diagnostics
Imports System.Web

Public Sub StartDefaultMail( _
ByVal [To] As String, _
Optional ByVal Subject As String = "", _
Optional ByVal Message As String = "" _
)
Try
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = _
"mailto:" & HttpUtility.UrlEncode([To]) & _
"?subject=" & HttpUtility.UrlEncode(Subject) & _
"&body=" & HttpUtility.UrlEncode(Message)
Process.Start(psi)
Catch ex As Exception
Throw _
New Exception( _
"Default mail client could not be started.", _
ex _
)
End Try
End Sub
///

Usage:

\\\
StartDefaultMail( _
"fo*@goo.baz", _
"Invitation", _
"Do you want to come to my party?" _
)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
np. u welcome.
regards

Wayne Wengert wrote:
That is an excellent resource - thanks!

Wayne

"Supra" <su*******@rogers.com> wrote in message
news:jE***************@news04.bloor.is.net.cable.r ogers.com...
www.vbip.com

Wayne Wengert wrote:

I have a Windows application in which users can select one or more
individuals and an email message is created which they then complete and
send. I currently use MAPI for this but I want to change the code to
invoke
whatever email client the users has as the default. Any pointers to some
information on how to do this would be appreciated.

Wayne



Nov 20 '05 #7

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

Similar topics

1
by: John Altland | last post by:
Here is my basic problem. I have a form that executes a cpu instensive algorithm occupying the first thread. When the algorithm is executed another form pops up telling the user the progress that...
1
by: Luboą ©lapák | last post by:
Hi, How can I invoke new render of aspx page from C# code. Thanks Lubos
14
by: stic | last post by:
Hi, I'm in a middle of writing something like 'exception handler wraper' for a set of different methodes. The case is that I have ca. 40 methods form web servicem, with different return values...
2
by: kapila Wijethilaka | last post by:
Hello, I want to invoke clients iExplorer from my axpx page. I did a some cod eto dot this.but it gave me below error. can anybody help me with this thanks Access is denied.
3
by: m.posseth | last post by:
Hello does someone know how i can invoke a method in the underlying thread without the usage of a window handle ?? This works perfect in a form Me.Invoke(New MethodInvoker(AddressOf...
3
by: FNZB | last post by:
Hi, Does anyone know how to do the equivalent of me.invoke from within a module? Cheers..
5
by: Richard | last post by:
Hello, I'm working on an application to allow our network team to use a small application to make DHCP reservations on our Microsoft DHCP Server. The problem is you have to use P/Invoke to do...
14
by: luc.saffre | last post by:
Hello, the simplest way to launch the user's standard mail client from a Python program is by creating a mailto: URL and launching the webbrowser: def...
2
by: Vighneswar | last post by:
Hi All I am doing with a standalone application in .NET, where I have to invoke the Outlook / Outlook Express by passing account info (username, password, pop3 server, ... etc) and SQL Server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.