473,670 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

send simple email with NET

Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL
Nov 16 '05 #1
5 4173

"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL
Try http://blogs.axosoft.com/hamids/articles/152.aspx

Nov 16 '05 #2
Hi TNL

This has been addressed several times here.

I have compiled the common answer in my snippets page 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
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL

Nov 16 '05 #3
thanks,
but I don't know, why it doesn't work. Error text:

An unhandled exception of type 'System.Compone ntModel.Win32Ex ception'
occurred in system.dll
Additional information: Der angeforderte Abschnitt war im Aktivierunskont ext
nicht vorhanden
(requested clause doesn't exist in activation context)

I use Outlook 2000 as standard email, I have tried to set Outlook express as
standard, but it doesn't work.

Do you have an idee?

Thanks
Nhan

"Mike Kitchen" <pu*******@hotm ail.com> schrieb im Newsbeitrag
news:eH******** ******@TK2MSFTN GP12.phx.gbl...
Hi TNL

This has been addressed several times here.

I have compiled the common answer in my snippets page 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
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL


Nov 16 '05 #4
You want to look at the System.Web.Mail namespace, in there there's a class
called SmtpMail that makes it all super easy.
http://msdn2.microsoft.com/library/System.Web.Mail.aspx

You can also read a blog I wrote about this:
http://dotnetjunkies.com/WebLog/john.../17/45329.aspx

--
John Wood
Blog: http://dotnetjunkies.com/weblog/johnwood
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL

Nov 16 '05 #5
Thanks,

I have downloaded your C# project. But "the file AssemblyInfo.cs could not
be opened", System can not find the file. I can't try your programm.

Otherwise, in my program "the System.Web.Mail namespace doesn't exist", it
can't not be compiled... Why?

Nhan
"John Wood" <sp**@isannoyin g.com> schrieb im Newsbeitrag
news:u$******** ******@TK2MSFTN GP12.phx.gbl...
You want to look at the System.Web.Mail namespace, in there there's a class called SmtpMail that makes it all super easy.
http://msdn2.microsoft.com/library/System.Web.Mail.aspx

You can also read a blog I wrote about this:
http://dotnetjunkies.com/WebLog/john.../17/45329.aspx

--
John Wood
Blog: http://dotnetjunkies.com/weblog/johnwood
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
Hi,

I want to send a simple mail with C#.
I have tried the following, but they don't work:
- some solutions on CodeProject websites.
- shellExecute(ma ilto:xx*@yyy.co m?subject=aaa&b ody=bbb).

Thanks for help
TNL


Nov 16 '05 #6

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

Similar topics

0
3696
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after days of reading posts and testing, I see it is not - unless I'm missing something? I'm not an email guru. All of my users will be running at least Windows 2000, most on XP sp2. Some of my users will have Outlook, many will be using Outlook...
1
1846
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 port 25 of the mail server. Works nice, but I can only send Emails to addresses on the same domain as mine (I'm me@myhost.net. I can send to you@myhost.net, but not myfriend@someotherprovider.com). I get a code back from the RCPT TO: command of...
1
5336
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It works except that I have two warning nuisances: 1) Program is trying to access email Addresses you have stored in Outlook. Allow access for ... 2) A program is trying to automatically send email on your behalf ... Heck, I am only trying to a send...
9
4302
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
10
24382
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
3
2662
by: growse | last post by:
Right, I've got a 2 c# programs here. Lets call them A and B. My aim is to send a simple string from B to A. A is always running. I've overridden the WndProc method to give me messages that are sent to it. B is a program that loads, sends a message and then quits. Let me give you the code to B (bits are missed out, but I've got the important stuff there): private const uint WM_USER_SENDTEXT = 0x8001;
3
4499
by: YMPN | last post by:
Hi Everyone, I'm deen from Riyadh. Please do help me with some problem i have. I have this formview control setup to recieved inputs from user (textbox, dropdownlist, others). After inserting, I want to send the data via email, the problem is how do I do that?
2
5631
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not support .asp,.aspx files, it supports PHP files, I'm searching in JavaScript ,but not found any matter, I'don't Know PHP.I'm having lot of pressure of higer officials.Please help me on this.
6
5933
by: =?Utf-8?B?TMOhemFybw==?= | last post by:
Hi everyone I've a simple ASP.NET Page that send a email using smtclient. The server is a Exchange and use my credentials to autentificated. The problem is that the send mail appear in the junk email folder. Any idea. Thanks
3
100032
digicrowd
by: digicrowd | last post by:
http://bytes.com/images/howtos/applemail_sig_icon.jpg You can make your emails fancy in Mail.app by using Rich Text formatting or even included Stationery. But, a simple way to send your own HTML creation (or any web page for that matter) is to use Safari. Follow these four easy steps. 1. Create the HTML Layout your HTML code including any images or graphics you'd like to include. In this example, we will make a simple birthday email to add...
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8903
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8592
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
8661
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...
0
5686
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4213
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...
1
2802
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
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1795
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.