'Sample Script to demontrate the use of the nntp interface
'Copyright www.aloaha.com

On Error Resume Next

'create object
Set news=CreateObject("pop3news.popnews")

'Set server and port
news.remotehost="news.microsoft.com"
news.remoteport="119"

'Set forward server properties. if left empty strings it will use pickup
SMTPServer="10.0.0.111"
SMTPPort="25"

'change mailfrom. if left empty string it will use the original
MailFrom="bla@bla.de"

'change recipient. If left empty it will use the original one
RCPTto="pop3sdk@aloaha.com"

'choose newsgroup
dummy=news.enter_group("microsoft.public.exchange2000.general")

'forward newest posting to mailaccount
Call news.send_email(news.get_article_as_CDO(CStr(news.lastnews)), CStr(SMTPServer), CStr(SMTPPort), CStr(MailFrom), CStr(RCPTto), "", "")

'display textbody of newest posting
'MsgBox news.get_article_as_CDO(CStr(news.lastnews)).subject+vbcrlf+vbcrlf+news.get_article_as_CDO(news.lastnews).textbody

'display messageheader of newest posting
'MsgBox news.get_newsheader(CStr(news.lastnews))

'display bodysource of newest posting
'MsgBox news.get_newsbody(CStr(news.lastnews))

'display messagesource of newest posting
'MsgBox news.get_article(CStr(news.lastnews))

Set news=nothing



