POP3 Email
page 1 of 6
Published: 23 Aug 2004
Unedited - Community Contributed
Abstract
Wouldn’t it be useful to be able to check your mail from a web browser? Here we look at how to write such a utility using the TcpClient class. Start from simply logging on to more complex issues like reading and deleting messages.
by Damian Manifold
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 63020/ 340

Introduction
POP3 Email
by Damian Manifold

.NET comes with some new and interesting toys, but the one thing that is missing is the ability to receive POP3 Mail. Here we will build a class to take care of this oversight.

View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 8 and 4 and type the answer here:

User Comments

Title: BR   
Name: BR
Date: 11/6/2009 8:54:35 PM
Comment:
Ola,
gostaria de atender seu cliente pelo telefone direto do seu site?
Agora você pode!

visite o site:

www.0800empresa.com.br

Não precisa instalar programas, atendimento imediato, qualidade perfeita de ligação, controle de gastos, tarifas super baratas, controle de horário de atendimento...

Você ainda atende seu cliente por e-mail?
Atenda seu cliente ao vivo pelo telefone entre no site:

www.0800empresa.com.br

Sua solução em atendimento ao cliente...

Este é um informativo único postado no seu site. Não enviaremos novamente a não ser que tenha interesse em maioores esclarecimentos, obrigado.
Title: MG   
Name: MG
Date: 10/20/2009 7:23:40 AM
Comment:
Olá pessoal!

Estivemos em seu site e achamos que tinha tudo a ver com o RHPortal.

Você pode divulgar sua empresa, produtos ou serviços GRATUITAMENTE no Guia de Fornecedores
http://www.rhportal.com.br/fornecedores/

O RHPortal recebe mais de 8.100 visitantes diferentes por dia e tem mais de 95 mil cadastrados.
Com certeza é uma excelente forma de divulgação de serviços e produtos de RH.

E é tudo GRATUITO!

Você também pode divulgar eventos, cursos, treinamentos, e ainda pode desfrutar de muito conteúdo para RH.

Visite: www.rhportal.com.br
e faça sua inscrição gratuita.

Será um grande prazer tê-los como parceiros.

Um grande abraço,
Alessandro Garcia
RH Portal
Title: SP   
Name: SP
Date: 10/18/2009 5:18:23 PM
Comment:
Boa noite, estou escrevendo para informar sobre a ultima novidade em divulgação empresarial para internet, conheça o GoogFx 2009.

COMO FUNCIONA ?
1- o programa faz um levantamento no Google e no Yahoo, buscando todas as empresas de um determinado segmento que você escolher;
2- depois acessa todos os sites dos resultados obtidos e envia apresentações como essa, automaticamente, preenchendo o 'FALE CONOSCO' do próprio site;
3- assim você pode enviar apresentações dos seus produtos e serviços, prospectar milhares de empresas rapidamente;
4 - o sistema desconsidera sites que não tenham formulario de contato, esses não serão contabilizados;
5 - é 100% garantido (todos os emails, sites, e "formularios de contatos unicos" extraidos, ficarão armazenados no seu PC)
segue o link para download do programa, faça um teste...gratis

site oficial: www.googfx.com.br

email: contato@googfx.com.br
ou: vendas@googfx.com.br
MSN: danilo.gaglioti@bol.com.br
cel: (11)-8407.6492
São Paulo - SP

para nao receber mais essa mensagem responda esse email com o TITULO "CANCELAR"
Title: 050   
Name: 050
Date: 10/16/2009 12:40:20 PM
Comment:
Planos de Saúde e Seguros.
www.jcplanosdesaude.com
MSN: jc-thomaz@hotmail
TWITTER: www.twitter.com/jcplanos
011 4112-0577 - 8234-4343 - 9249-2007
Title: SP   
Name: SP
Date: 9/30/2009 6:33:49 AM
Comment:
Olá, Estou entrando em contato para indicar para você o melhor site de Classificados Gratuitos onde o nome ja dis tudo, Quero Comprar bom para quem quer vender ideal para quem quer comprar.

COMO FUNCIONA PARA QUEM QUER VENDER
Você se cadastra gratuitamente e pode colocar até 30 anuncios com até dez fotos cada.

COMO FUNCIONA PARA QUEM QUER COMPRAR
Basta entrar no site procurar o produto desejado e entrar em contato com o vendedor para fechar o negocio.

Ninguem paga nada é tudo gratuito então não espere para anunciar, vender ou comprar um produto no Quero Comprar é tudo muito facil. http://www.querocomprar.com
Title: SP   
Name: SP
Date: 9/14/2009 2:01:41 PM
Comment:
Olá,

Somos o Original Bureau Design, um escritório de Design Gráfico, WebDesign e Desenvolvimento de Sistemas e Softwares Gerenciais, estamos entrando em contato com os senhores para divulgarmos nossos serviços de consultoria em Tecnologia da Informação.

Trabalhamos com diversos níveis de projetos:

1. WebSite Estático
2. WebSite Estruturado
3. WebSite Comercial
4. Intranet
5. Extranet
6. E-Business

Nossos profissionais são todos graduados em cursos superiores e tem know-how nos mais diversos tipos de desenvolvimentos, seja para o setor privado ou para os Governos Municipais, Estaduais ou para o Governo Federal, através das secretarias de planejamento.

Caso tenha interesse em qualquer tipo de desenvolvimento de tecnologia para sua empresa, favor entrar em contato conosco para possível esclarecimento de serviço e agendamento de reunião.

Atenciosamente,

Adm. Renan Vito
CRA nº 109.379
obureau.com

+ 55 11 9147 6646
renan@obureau.com
Title: SP   
Name: SP
Date: 9/11/2009 11:11:24 AM
Comment:
Boa tarde Srs

Sou programador de sistemas e softwares, estou entrando em contato para oferecer a solução definitiva para a divulgação do site da sua empresa.

conheça o GoogFx site oficial: www.googfx.com.br

Se sua empresa tiver interesse em difundir sua marca na internet, entre em contato diretamente comigo, pelo email: contato@googfx.com.br, por telefone (11)-8407.6492 , ou acesse www.googfx.com.br

É a maneira mas inteligente e inovadora de expandir seu mercado e não prejudicar a imagem da empresa, já que esse tipo de Robot não é caracterizado como SPAM.

Seria como ter 1000 pessoas pesquisando na internet todos os dias e prospectando novos clientes para sua empresa.

Pense nisso, e estou a disposição para quaisquer esclarecimentos... Obrigado desde já e tenha uma boa tarde.

email: contato@googfx.com.br
ou: vendas@googfx.com.br
MSN: danilo.gaglioti@bol.com.br
cel: (11)-8407.6492
São Paulo - SP
Title: Deepak   
Name: Saxena
Date: 5/30/2009 5:21:03 AM
Comment:
i want to use you downloads
Title: problem with body mail   
Name: super
Date: 4/12/2009 6:53:44 AM
Comment:
Hi,
This article is helpful. But, I have a big problem with the display of contain's (body) mail. This code displays more informations, letters and numbers without any meaning .
I think that the contain is not formated. Can one help me ?

rafii.mili@gmail.com
Title: Prob. In Running   
Name: Cutama
Date: 4/6/2009 7:58:21 AM
Comment:
DPM assemblies are not necessary, I've removed the reference to DPM assemblies but hte code still runs fine.

However, when I run the code using break points everythign is fine. However, when I deploy the code it pops up errors at c.text=server.htmlencode(m(cnt)..... some tines it is at To and soem times it is at the body.

Pls. Help.
Title: How can I get Assembly?   
Name: Neetu
Date: 3/20/2009 12:51:16 AM
Comment:
Hello There,,

Plz , Can u tell me
how i can download the DPM assembly.
<%@ Register TagPrefix="cc1" namespace="DPM" Assembly="DPM" %>?
waiting for your reply
Title: How to Get only Plain Text   
Name: Nilesh
Date: 12/23/2008 2:11:33 AM
Comment:
HI,
Please give me the code how to Get only plain Text.
Thanks
Title: How to get all the Emails Read/Unread)   
Name: ravi gupta
Date: 12/16/2008 6:29:39 AM
Comment:
HI,
Please give me the code how to Get all emails regardless of Read/unread.

Thanks
Title: Time Outs   
Name: DVD
Date: 12/15/2008 7:00:16 PM
Comment:
This is really helpful code but I'm experiencing really slow performance when I'm accessing even just the headers of a POP3 box with 200+ messages in it (a total of 9mb of mail)and timeouts if I try to access the bodies. Even your demo pages on here time out. When I use a webmail interface to access this mailbox it is much faster. Could you please help identify the source of this problem? Thanks.
Title: Will Not Run On Live Server   
Name: John
Date: 10/15/2008 5:12:20 PM
Comment:
HI

This code works great when running from a test machine and connecting to pop3 on our live server.

But once it gets installed on live server, the page times out.

Any ideas? Do I have to rename the pop3 server as it is local?
Thanks,
John
Title: -ERR Unacceptable command   
Name: Simon
Date: 10/14/2008 10:52:26 AM
Comment:
Hi.

Firstly, thanks for the code, it;s going to really help us.

Getting a problem with the getMail funstion though.

The line: msg = SendCmd("retr " + m.ID.ToString + " 0")

effectively this is writing (for 1st message):
SendCmd(retr 1)

However it is returning:
-ERR Unacceptable command

Any ideas?

Thanks in advance.
Title: plz help me   
Name: raghavenrdra
Date: 9/27/2008 6:57:09 AM
Comment:
how i can download the DPM assembly.
<%@ Register TagPrefix="cc1" namespace="DPM" Assembly="DPM" %>
Title: how to send mails in pop3   
Name: Raghavendra
Date: 9/27/2008 2:31:33 AM
Comment:
hi there.
i read ur artical but i need C#.net code and is there any configure on my system means settings.plz help me.
Title: Outstanding   
Name: Mike
Date: 8/26/2008 3:40:50 PM
Comment:
Outstanding code - THANKS!
Title: email logout   
Name: The 2 Tops
Date: 8/8/2008 7:10:16 AM
Comment:
I logged onto another computer and accessed my e-mail via my Virgin media account. That computer now has my e-mail address and password, in addition to their own, and that user cannot remove my details. Is it possible for one of us to rectify this?
Title: Unread Messages   
Name: DamianM
Date: 5/5/2008 5:13:10 AM
Comment:
POP3 makes no distinction as to whether a message is read or unread. This has to be done in the client.
Title: pop3   
Name: sekhar
Date: 5/5/2008 5:06:59 AM
Comment:
hai,

how to read unread messages from pop3 server
Title: Create New Mail id   
Name: Swati
Date: 5/2/2008 2:43:20 AM
Comment:
Can anyone let me noe how can I make a new mail id in POP 3 server. The thing I want is whenever a new employee joins our organization the new mail id is automatically created on mail server. Plz advice.
Title: telnet   
Name: DamianM
Date: 4/24/2008 9:44:27 AM
Comment:
If you cannot connect via telnet, either the url or the port number is wrong. These are the only variable i can think of.
Title: popcommand with telnet   
Name: fathima
Date: 4/24/2008 7:50:50 AM
Comment:
i have tried to connect pop mail thro telnet.. it doesnt connect.. how can i find where the problem is..
Thanks
Title: GMail   
Name: DamianM
Date: 4/23/2008 4:43:05 AM
Comment:
The only reason I can think of it not working isthat some of the responses might be different to when this was first written.
Try to connect to the pop mail via telnet and see what responses you get.
Title: NetworkStream problem   
Name: Fathima
Date: 4/23/2008 2:42:19 AM
Comment:
Hai,

We use "pop.gmail.com" as server and portnumber as 995.

private s as System.Net.Sockets.NetworkStream
private t as new System.Net.Sockets.TcpClient()
private Cnct as Boolean = false

public Sub new(ByVal Server as string)
Try
t.Connect(Server, 995)
s = t.GetStream()
if Left(getData(), 3) = "+OK" Then
Cnct = true
End if
catch
End Try
End Sub


*************************
From this, we could not get stream data. kindly help to solve this problem.

Thanks in advance
Fathima
Title: .   
Name: DamianM
Date: 4/22/2008 4:10:54 AM
Comment:
The DPM assemblies are not part of the pop3, they are part of the display. They can be ignored.
Title: pop3 email   
Name: fathima
Date: 4/22/2008 1:30:15 AM
Comment:
sir,
what about this DPM assembly.. where can i find these..
with regards,
-fathima
Title: POP 3 Email   
Name: Murali
Date: 2/27/2008 1:55:47 AM
Comment:
Sir
Your codes are very grate but i need the sample source project for my reference. if you can possible please send it to me. my email id is mkmurali.mca@gmail.com. i am expecting to your reply.

Thank you.
By
Murali
Title: Retrieve Message and Headers   
Name: ibraheem Ammrieh
Date: 1/16/2008 9:18:11 AM
Comment:
this code is very grate but it doesn't work on local. you can test this piont. there is a problem in securiy or something else
Title: plz help me   
Name: prashant
Date: 12/22/2007 10:10:53 AM
Comment:
my email id is adc_jain2005@yahoo.co.in

even can you tell me how to read pop3 mailbox which are SSL enabled
Title: plz help me   
Name: prashant
Date: 12/22/2007 10:09:41 AM
Comment:
object reference not set to the instance of the object
in the line
c.text=server.htmlencode(m(cnt).body)....
can you pls tell me how to solve this error or can you send me the project in which your coding is working perfectly
Title: plz help me   
Name: prashant jain
Date: 12/22/2007 10:08:16 AM
Comment:
thank you for replying me
in this coding when i run on the demo you have given then it runs fine without any problem but when i copy paste the coding in my project i run fiine if i debug but if i run without debugging then it gives folllowing error
Title: Attachments   
Name: Damianm
Date: 12/21/2007 6:34:12 AM
Comment:
In the world of pop3 there is really no such think as attachments its all just text, attachments are stored in the email encoded in some form, usually mime. Reading an attachment is just a matter of reading the text from the email them decoding it.
Decoding it depends on how it was decoded as is technically very different from the scope of this article.
Title: pls help in reading attachment   
Name: prashant jain
Date: 12/21/2007 1:21:36 AM
Comment:
its fine
but on reading attachment its gives error
can you please tell me how to read attachment
please mail me on adc_jain2005@yahoo.co.in
Title: Entire Source Code   
Name: Don Sharp
Date: 12/2/2007 6:12:04 PM
Comment:
Is it possible to get the entire source code for this project?

Thanks
Title: Error While trying to view the code   
Name: Balaji
Date: 8/12/2007 11:27:39 PM
Comment:
While trying to view the popmail.aspx.vb, it throws error. Can you please correct the error and help me in getting the content of that page.

Thanks
With Regards
Balaji.
Title: Unread Email   
Name: DamianM
Date: 7/23/2007 5:21:32 AM
Comment:
There is no way using pop3 to determine whether an email is read or unread. This is done by the email client, such as outlook, they keep track of this and it is not a function of POP3.
Title: Help me please !!!   
Name: Edmond
Date: 7/21/2007 9:49:41 AM
Comment:
HI ~
I'm currently doing my project about mail notification tool on the system tray.
My project should be able to check if some new mail is available now from the pop3 webmail server(yahoo mail, hotmail and Gmail). And I will coding in Visual Basic 2005.
But now,I still having some problems. Could you please help me how to check the unread mail from pop3 webmail server.

Please help me. Thanks
Here my email address : ahyeap_4yw@hotmail.com

Best regards,
Edmond
Title: Uread Mail   
Name: Mostafa
Date: 9/14/2006 7:12:42 AM
Comment:
hi
i need to read and save Uread Mail and Attachment
how can i do this
Title: How to get unread emails   
Name: Naveen
Date: 8/9/2006 3:31:15 AM
Comment:
i want to get the all unread mail from the pop3 server. could you please help me how to check the unread mail from pop3 server. i am able to read all mails from POP3 but i am not able to Identify them read/unread.

Please help me

Regards,
Naveen.
naveen_it@hotmail.com
Title: POP3 EMails   
Name: Nirav Dolia
Date: 8/1/2006 9:48:28 AM
Comment:
i want to get the all unread mail from the pop3 server. could you please help me how to check the unread mail from pop3 server. i am able to read all mails from POP3 but i am not able to Identify them read/unread.

Please help me

Thanks
Nirav Dolia
dolianirav@gmail.com
Title: Error in code   
Name: Andy
Date: 6/16/2006 1:35:49 PM
Comment:
I noticed a bug in the following method which was causing the mail body not to be displayed properly:

Public Function getMail(ByRef m As MailMessage) As Boolean
Dim msg As String
Dim hend As Integer

'make sure the buffer is big enough to hold the message.
'to be sure make it just a little bigger
't.ReceiveBufferSize = m.Size
msg = SendCmd("retr " + m.ID.ToString + " 0")

Changing the above line to :
msg = SendCmd("retr " + m.ID.ToString + vbCrLf)
resolved the problem.

Hope this saves someone time. Nice article although!
Title: Excellent Article   
Name: engineer3000
Date: 6/3/2006 4:10:14 AM
Comment:
Hi Buddy,Excellent article. you did a greate job. Thanx a lot....
Title: POP Mail   
Name: Dinesh
Date: 5/29/2006 8:44:32 AM
Comment:
its fantastic
Title: This is Excellent   
Name: Rajendra
Date: 4/29/2006 12:54:37 AM
Comment:
Great article, exactly what I am looking for, But now I have to translate it to C# to work with my application. Do you by chance have the Source code in C#?
Title: Source in C#?   
Name: Paul
Date: 4/29/2006 12:08:00 AM
Comment:
Great article, exactly what I am looking for, But now I have to translate it to C# to work with my application. Do you by chance have the Source code in C#?
Title: Wonderful   
Name: Deric
Date: 4/19/2006 2:57:07 PM
Comment:
This is great.

Thanks.
Title: Tiwari   
Name: Aashutosh
Date: 4/11/2006 12:26:19 AM
Comment:
Fine article but better to make it in c#.
Title: pop3   
Name: William Wallace
Date: 8/31/2005 5:54:45 AM
Comment:
thanks a lot.... this article is excellent... a great help...
Title: POP3 EMail   
Name: Pankaj
Date: 7/15/2005 9:35:06 AM
Comment:
Hi,
I was looking for such a code and I really found it gr8. I really appreciate for putting this article on the web. It has taken me 2 days to find this article and I really find it very useful. Thanks for this article.
gr8 work
********** THIS ARTICLE IS ULTIMATE IN ITS DOMAIN **********
Title: Very Good   
Name: Abhijit Kulkarni
Date: 10/6/2004 5:20:26 AM
Comment:
This is really good. Help me very much.

Thanks
Abhijit
Title: Excellent   
Name: Bahadir ARSLAN
Date: 8/27/2004 2:20:16 AM
Comment:
Excellent work!
Very easy and clear article...
Title: Progger   
Name: Rob
Date: 7/12/2004 4:32:06 AM
Comment:
Excellent, i enjoyed the article and will use some of it and give credit where it is due.

Thanx again
Rob

Product Spotlight
Product Spotlight 






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 11/8/2009 5:41:35 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search