get mail using System.Net.Mail

How can i get Email usign System.Net.Mail ??
2/4/2008 4:12:22 PM 93655 articles. 5 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 35

Hello poloxy  ,

the System.Net.Mail used only for sending emails and not to receive them.

Read the full documentation at  MSDN Library


Hosam Kamel

Remember to click on Mark as answer on the post that helped you
2/4/2008 4:45:58 PM
SO how can I receive mail ?
2/4/2008 5:55:54 PM

Try one of these pop3 libraries 

Hosam Kamel

Remember to click on Mark as answer on the post that helped you
2/4/2008 6:07:46 PM


  if you want to send email by using System.Net.Mail, here is some code,you can try it,hope to help you,thank you.

        MailMessage mail = new MailMessage();

        //set the addresses
        mail.From = new MailAddress("sender mail address");
        mail.To.Add("receiver mail address");

        //set the content
        mail.Subject = "This is an email";
        mail.Body = "this is the body content of the email.";

        // set the attachment
        Attachment MyAttachment =new Attachment ("attachment address");
        //send the message
        SmtpClient smtp = new SmtpClient("");
        smtp.EnableSsl = true;
        smtp.Port = 465;
        //pwd and user authentication
        smtp.Credentials = new NetworkCredential("sender mail userName", "sender mail password");

Hua Jun Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
2/7/2008 3:21:10 AM

It depends what you mean by "receive" email.
Do you want people to send you email, and revieve it? In that case, you want a SMTP server, so you can accept email.

However, do you really mean you want to "retrieve" email? If that's the case, it depends upon your mail server. There are 2 main RFCs for doing this: The POP3 protocol and the IMAP4 protocol. Depending upon which one of these your mail server implements (or, when one you want to use -- if your mail server implements both), then you will need to appropriate solution.

In any case, System.Net.Mail cannnot receive or retrieve email. You will either need to code your own solution, or purchase a 3rd party product.

Some of my websites
2/8/2008 12:24:02 AM

Similar Artilces:

Problem with difference between System.Web.Mail and System.Net.Mail in using attachments
I have a web .Net app which sends emails with attachments.  After the email is sent I clean up aftermyself and delete the attachments from disk.   In upgrading to .Net 2  I changed the email logic from using system.web.mail to  (of course vs is telling me system.web.mail is obsolete).In .Net 1.1,  the files deleted with no problem but in .Net 2 when I attempt to delete  I receive The process cannot access the file ...' because it is being used by another process. If I change the code back to using system.web.mail I can delete the file...

What additional advantage we get through over the old system.web.mail?
What additional advantage we get through over the old system.web.mail?Is it needed to configure the smtp server? Plz tell me the steps to develop the email sending facility in our applicationSwati Jain Take a look at Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue....

System.web.mail to
I converted a web app from VS 2003 to VS 2005. i now get error message when i build it  stating system.web.mail  is obsolute,  use i redefine to but now i get other error message such as smtpMail does not exist in the current context. cannot implicitly convert type string to System.Net.Mail.MailAddress   so System.Web.Mail want work in web app convert to VS 2005 running on framework 2.0?           because if i change to System.Net.Mail  i am ...

Help for Visual web dev isolate system.web.mail to
Hi all,  I'm new user to visual web developer express software. Laterly i found this application isolate quite some of the component namespace, like system.web.mail to net.mail. I not well understand how functional?? Does it act same as system.web.mail?? My coding below: change system.web.mail to which causing a lot error... *****Can anybody correct me or advise me how to make this code work in <%@import Namespace="" %> <script runat="server">    Public FromAddress As String = "" .......

switching from system.web.mail to
I have been converting my code from system.web.mail to  I have been able to convert the to, from, cc, and message body to the new format easily question is how do i convert this into format?SmtpMail.SmtpServer = "server";                SmtpMail.Send(mail);Would this be the solution?SmtpClient client = new SmtpClient("server");                client.Send(mail); Here's a full example of how to per...

difference between System.Web.Mail and System.Net.Mail
What is difference between System.Web.Mail and System.Net.Mail  namespace?What is use of both ? System.Web.Mail was in .NET Framework v1.1System.Net.Mail is in .NET Framework v2.0 and greaterSame use, although there is more functionality in System.Net.Mail since it is a later version of the framework. Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you!  What All-Star said. I assume the reason it was moved to a different namespace is because the internet is actually a suite of technologies: e-mail, ftp, http (web), etc. E-mail and...

Working with System.Web.Mail but not with System.Net.Mail
Hi, i am having trouble sending e-mails using System.Net.Mail namespace while there is no problem with System.Web.Mail. I am  using remote smtp server with no authentication.  My code as shown below:1 try2 {3 MailMessage message = new MailMessage();4 message.BodyFormat = MailFormat.Html;5 message.To = "";6 message.From = "";7 message.Subject = "Test Smtp";8 message.Body = "TestMail 123";9 10 SmtpMail.SmtpServer = "mail.mysmt...

Migrating from System.web.mail to
Hi Every1,I've recently used the System.web.mail to send mail, using the IIS's smtp server.Doing this, i didn't really need to do anything in the web.config file or give any special parameters to the client. It just assumed i was working with my very own smtp service that came with the IIS and everything worked fine.Now i migrated to and now i need to insert my smtp service's host location under <> in the web.config file.However, i don't know what to write there so the client will use my smtp sevice (host="localhost" doesn't work)can any1 help me on this one?t...

Changing System.Web.Mail to System.Net.Mail
I am trying to learn ASPI have been using the Visual Web Developer 2005I have the following line that I can not work out how to convert.<%Dim FromForm As String = ""Dim ToMe As String = ""Dim FormSubject As String = "Contact Infomation"Dim EmailText As String = "Blar Blar Blar"System.Web.Mail.SmtpMail.Send(FromForm,ToMe,FormSubject,EmailText)%>It tells me that I cannot use System.Web.Mail any more and should use System.Net.Mail. I have been unable to work out what the new code should be to get it to work.The Language is VBCan anyone tell me how to change...

System.Web.Mail vs System.Net.Mail
Hi AllI was using System.Web.Mail in an application on our test server.  That worked fine.  I never had to specify a server or change any settings.  It just works.  Whatever settings the server has set up are used.  This is great.I saw that System.Web.Mail has been deprecated, so I'm trying to use System.Net.Mail.  I'm having a problem.  Net.Mail doesn't use whatever settings Web.Mail used.  I can't send e-mail with Net.Mail.  I see several people use the web.config file to set the server up, but I can't get that to work. I jus...

Converting from System.Web.Mail to System.Net.Mail
Hi there, I'm from Argentina. I've converted System.Web.Mail (code is underlined) to System.Net.Mail (code is Bold) . I'd like to know if it's correct. Thanks !!public uint enviar()        {            try            {                // Abrir el archivo que contiene el template del HTML.                // Envia el mail con el HTML.&nbs...

E-mail form data using authenticated smtp relay (
Hi, out there, I have a set of forms on my site that work fine e-mailing the data back to me with the free e-mail frommy current host, whose smtp relays do not require authentication.  However, there's a tight limit on the number of relays I can have a day.  Due to traffic, I would like my forms now to reference another "From" e-mail, from host with unlimited smtp relays.  Unfortunately, their e-mail requires authentication, and having combed these posts for hours, as well as others, I can't find a working solution to my problem.  It's more...

Sending Mail Using System.Net.Mail with out using User credentials
HI, I have an application where in i send mails based on some condition, the user is already authenticated, so i need not check the User Credentials.Right now this is how the piece lokks:- mailClient.Credentials = new NetworkCredential(USERID, USER_PWD,DOMAIN); I want to send the mail, with out validating the user credentials, Can i skip the above line. Please post aqlong with the sample code.   Thanx in Advance. Anil Kumar.   I think you cannot skip. but store user credentials in session variables after login and then pass.If this post was useful to you, please mark it as...

Why do Sending SMTP Authenticated E-mail succeed using SmtpMail.Send() function but fail using SmtpClient.send() function ? Bugs in System.Net.Mail.SmtpClient when send a Authenticated E-mail?
I click btnOK button, the email can send OK, but click btnFail button,  the following error is displayed! why ? you can test the section code. The SMTP, username, password are valid!  Many thanks! "Syntax error, command unrecognized. The server response was: authentication failed,decode user password error" I have tested some other SMTP, somes is OK. I think there are some bugs with System.Net.Mail.SmtpClient when send a Authenticated E-mail with some SMTP!   //------------------------------------------.ASPX Code----------------------------------------...

Web resources about - get mail using System.Net.Mail -

List of areas in the United States National Park System - Wikipedia, the free encyclopedia
The National Park System of the United States is the collection of physical properties owned or administered by the National Park Service . This ...

The Stack Pack is a wireless charging system for the iPhone 6s/6 and 6s/6 Plus
If youre tired of waiting for Apple to finally bring any type of wireless charging system to the iPhone, definitely take a look at an interesting ...

8 bits, 8 players, 8 projectors, and one Nintendo Entertainment System
... the nerdy ingenuity of ETH Zurich, the creativity of Disney researchers, and a swanky Swiss night club with a 360-degree projection system? ...

Microsoft has announced the date it will kill support for its mobile operating system
Microsoft has announced that it will kill support for Windows 10 Mobile, its consumer and business operating system for smartphones, on August ...

Registration for new 'Nintendo account' system opens in Japan
Gamers in Japan can now register for the cross-platform service.

Ford marries its SYNC system to Apple’s Siri using Bluetooth
Ford today announced a software upgrade to its SYNC infotainment system that lets iPhone users wirelessly access Siri Eyes-Free capabilities ...

Uber Testing Color-Coded Light System To Help Passengers Find The Right Ride
... the wheel asked if my name was Kristy (it isn’t). Uber is testing a way to keep such mixups from happening with a color-coded light system to ...

Vetr Inc. Lowers Cisco Systems, Inc. (CSCO) to Buy
Insider Monkey (blog) Vetr Inc. Lowers Cisco Systems, Inc. (CSCO) to Buy Dakota Financial News Cisco Systems logo Cisco Systems, Inc. (NASDAQ:CSCO) ...

TSMC expands production based on GaN Systems technololgy
GaN Systems, a maker of gallium nitride power transistors, has announced that its foundry partner Taiwan Semiconductor Manufacturing (TSMC) has ...

OnePlus 2 Ditches Invite System on December 5 FOR-EH-VER, FOR-EH-VER.
... be able to buy their NFC-less phone, the OnePlus 2 , without an invite on December 5. This isn’t a temporary thing, though, as the invite system ...

Resources last updated: 12/4/2015 1:44:17 AM