[thelist] E-mails into database (again!)

Kevin Stevens kjs at ratking.co.uk
Mon Aug 8 06:51:01 CDT 2005


> If you're doing it on a server you own then go for the .net version.  I 
> used some code from code project for the POP3 component [1], and then to 
> actually do the > connecting the code is as easy as:

Thanks for this, I don't know .net but I figured it would be what I need. 
Will this run straight away on IIS or do I have to download and install 
anything? Reason I ask is that the CDONTS method I wanted to use meant 
installing something on the server first, which I am not able to do. I think 
I understand most of the code below, but I do have a few questions...

            Dim pop = New pop3.Mail.Pop.Pop3
            pop.Host = ConfigurationSettings.AppSettings("EmailHost")
            pop.Port = ConfigurationSettings.AppSettings("EmailPort")
            pop.Username =
ConfigurationSettings.AppSettings("EmailAccount")
            pop.Password =
ConfigurationSettings.AppSettings("EmailPassword")
            pop.connect()
            pop.login()
            pop.GetAccountStat()

            If pop.MessageCount > 0 Then
                For i As Integer = 1 To pop.MessageCount
                    Dim m As pop3.Mail.Pop.Pop3Message =
pop.GetMessage(i)
    Next
            End If

1. I will be accessing a Freeserve account, so is the EmailHost in line 2 
pop.freeserve.com?
2. Presumably I need to set EmailPort to 110
3. What does pop.GetAccountStat() do? I can't find anything about it.
4 Does this return the e-mails as a string? If so is m the string, e.g. if I 
added the line response.write m would it print out the e-mails?
5. Do I not have to close the connection to the pop3 server?
6. You gave me the link http://www.codeproject.com/csharp/pop3client.asp but 
this seems to be about C#, am I missing something obvious because I can't 
see how that relates to the code above.

I think maybe a trip to the bookshop for a .net book is in order :)

Kevin Stevens
kjs at ratking.co.uk 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.2/65 - Release Date: 07/08/2005



More information about the thelist mailing list