473,386 Members | 1,798 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.

How to send a mail without smpt ?

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
2 3885
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: StevenBarnes | last post by:
I need to have some .Net code be able to send Email using my ISP's SMTP server. I found some articles on how to use the MAIL FROM: and RCPT TO: commands that you can stream to a tcp connection on...
3
by: Enrique Palomo Jiménez | last post by:
Hello all, i'd like to send mails from my account. At office it's easy because, i can access directly to the mail server and smpt works fine. but now, i'm working out of office and i can...
3
by: NurAzije | last post by:
Hi, I have a huge mailling list and want to check which mails are real and which does not exists to reduce the size, is there a function which will check if mail@mailserver.somthing exists or not...
5
by: Yossi Naggar | last post by:
Hello to everyone, Does anybody know how to send html formatted messages with asp.net? I tried to send such messages with the code below but the content type is wrong. The content type is...
3
by: trialproduct2004 | last post by:
Hi all, i am having application in c# for sending mails. I want to ask few question related to sending mail. If address of smtp server is not set, then will the mails be send to address...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
4
by: CLEAR-RCIC | last post by:
I want to send an email from our Intranet site to myself whenever an error happens. Our manager will not let us install SMTP on the web server. Is it possible to send email programatically...
1
by: vermarajeev | last post by:
Hi guys, I have a plain text file. I want to encrypt and send this file via mail. I use SMTP to send the file over network. I'm able to send the file in plain text but if I encode and send it, I...
5
by: Don Quijote de Nicaragua | last post by:
Hi, everyone I try to send a simple e-mail witch this Code, but always send me a error messages: "ERROR: Failure sending mail." Thansk You. Don Quijote de Nicaragua. Elder Soto. Dim correo As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...

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.