By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,678 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,678 IT Pros & Developers. It's quick & easy.

How to send a mail without smpt ?

P: n/a
Hello,

I need a function to send a mail from a winform application. I don't belive,
that I can use smtp, because I neither know the mail address of the sender
nor the smtp server (or can it be "localhost" ?). I only want to set the
receiver mail address (it's me), the subject and the body text. And I want
to send the mail with the default mail client of the user.
How can I do that ?

With regards
Heinz
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
This is the easy way :

using System.Diagnostics;

string toEmail = "de**@publicjoe.co.uk";
string subject = "Love the Program";
string body = "Thanks a lot";
string message = string.Format( "mailto:{0}?subject={1}&body={2}", toEmail,
subject, body );

Process.Start( message );

Add this to a linklabel and bobs your uncle.

Example app can be found at
http://www.publicjoe.f9.co.uk/csharp/snip/snip007.html
Hope this helps

Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html

"Heinz Z." <no****@irgendwas.de> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
Hello,

I need a function to send a mail from a winform application. I don't belive, that I can use smtp, because I neither know the mail address of the sender
nor the smtp server (or can it be "localhost" ?). I only want to set the
receiver mail address (it's me), the subject and the body text. And I want
to send the mail with the default mail client of the user.
How can I do that ?

With regards
Heinz

Nov 16 '05 #2

P: n/a
Yes, that solves my problem.
Thank you, Heinz
"Mike Kitchen" <pu*******@hotmail.com> schrieb im Newsbeitrag
news:Oo**************@TK2MSFTNGP09.phx.gbl...
This is the easy way :

using System.Diagnostics;

string toEmail = "de**@publicjoe.co.uk";
string subject = "Love the Program";
string body = "Thanks a lot";
string message = string.Format( "mailto:{0}?subject={1}&body={2}", toEmail, subject, body );

Process.Start( message );

Add this to a linklabel and bobs your uncle.

Example app can be found at
http://www.publicjoe.f9.co.uk/csharp/snip/snip007.html
Hope this helps

Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html

"Heinz Z." <no****@irgendwas.de> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
Hello,

I need a function to send a mail from a winform application. I don't

belive,
that I can use smtp, because I neither know the mail address of the sender nor the smtp server (or can it be "localhost" ?). I only want to set the
receiver mail address (it's me), the subject and the body text. And I want to send the mail with the default mail client of the user.
How can I do that ?

With regards
Heinz


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.