'Copyright by Aloaha
'Please download freeware SDK from http://www.aloaha.com/download/pop3sdk.zip

Dim dummybool
Set pop=CreateObject("pop3news.popnews")
pop.remotehost="192.168.0.111"
pop.remoteport="110"
pop.username="pop"
pop.password="pop"

If pop.autoconnect=true Then
	MsgBox CStr(pop.getammount), vbOKOnly, "Amount of mail in POPBox"
	If CLng(pop.getammount)>0 Then
		MsgBox CStr(pop.getsubject(CStr(pop.getammount))), vbOKOnly, "Subject of newest mail"
		MsgBox CStr(pop.getheader(CStr(pop.getammount))), vbOKOnly, "Header of newest mail"
		MsgBox CStr(pop.getmail(CStr(pop.getammount))), vbOKOnly, "Complete newest mail"
		MsgBox CStr(pop.getmail_as_CDO(CStr(pop.getammount)).textbody), vbOKOnly, "Textbody of newest mail"
		MsgBox CStr(pop.getmail_as_CDO(CStr(pop.getammount)).htmlbody), vbOKOnly, "Htmlbody of newest mail"
		MsgBox CStr(pop.get_headerline(CStr(pop.getheader(CStr(pop.getammount))),"Message-ID:")), vbOKOnly, "MessageID Line"
		MsgBox CStr(pop.get_headermail(CStr(pop.getheader(CStr(pop.getammount))),"From:")), vbOKOnly, "From:"
		MsgBox CStr(pop.get_headerdomain(CStr(pop.getheader(CStr(pop.getammount))),"To:")), vbOKOnly, "To Domain"
	End If
	dummybool=pop.close_and_quit
End If

Set pop=nothing
Set news=CreateObject("pop3news.popnews")
news.remotehost="news.microsoft.com"
news.remoteport="119"


If news.autoconnect=true Then
	'MsgBox news.getgroups
	If Len(news.enter_group("microsoft.public.inetserver.iis.smtp_nntp"))>0 Then
		MsgBox CStr(news.enter_group("microsoft.public.inetserver.iis.smtp_nntp")),vbOKOnly,"Entered Group"
		MsgBox CStr(news.get_newsbody(CStr(news.lastnews))),vbOKOnly,CStr(news.get_article_as_CDO(CStr(news.lastnews)).subject)
	End If
End If
dummybool=news.close_and_quit
Set news=nothing