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

object must be created with 
Set pop=CreateObject("pop3news.popnews")

Public Function connect() As Boolean
'function connects to pop or news server - please check also autoconnect

'if you want to connect to a pop server you need to set the following variables first
'remotehost as string
'remoteport as string
'username as string
'password as string
'service as string (will be set automatic to "pop" if remoteport is "110"

'if you want to connect to a news server you need to set the following variables first
'remotehost
'remoteport
'service as string (will be set automatic to "news" if remoteport is "119"

End Function


Public Function autoconnect() As Boolean
'should be called instead of connect
'it checks if allready connected and only connects if not connected
'variables should be set like in connect
End Function

Public Function close_and_quit() As Boolean
'closes current connection
End Function

Public Function getammount() As Long
'returns ammount of mails in your popmailbox
'calls autoconnect automatic if not connected allready
End Function

Public Function getsubject(mailnummer As String) As String
'retrieves subject of mail with mailnumber
End Function

Public Function get_subjectarray() As String()
'returns all subjects of your mailbox as array of string
End Function




Public Function getheader(mailnummer As String) As String
'returns mailheader of mailnumber
End Function

Public Function getmail_as_CDO(mailnummer As String) As CDO.Message
'returns mail as CDO
End Function

Public Function getmail(mailnummer As String) As String
'returns mail as string
End Function


Public Function deletemail(deletemails As String) As Boolean
'marks mails in comma seperated list for deletion
'for example deletemail("1,5,7")
'please note that mails get purged only from mailbox after closing connection
End Function


Public Function send_email(cdomail As CDO.Message, smtpserver As String, port As String, mailfrom As String, mailto As String, username As String, password As String) As Boolean
'sendmail
'some fields like username, password can be left empty if smtp server does not 
'require authentication
'if port and smtpserver are left empty pickup will be used   
End Function


Public Function return_IP_array(searchtext As String) As Variant
'returns stringarray of IP Numbers found in header
End Function


Public Function return_IP_array_as_string(searchtext As String) As String
'returns IP numbers found in header as commma seperated list
End Function


Public Function return_mail_array(searchtext As String) As Variant
'returns email addresses found in header
End Function

Public Function return_mail_array_as_string(searchtext As String) As String
'returns email addresses found in header as comma seperated list
End Function

Public Function get_headermail(headerblock As String, valuename As String) As String
'extracts email of value name from header. For example a value name could be From:
End Function

Public Function get_headerdomain(headerblock As String, valuename As String)
'extracts domain of value name from header. For example "To:"
End Function

Public Function get_headerline(emessage As String, headername As String) As String
'returns headerline specified in headername - for example "Message-ID"
End Function

Public Function get_article(mnumber As String) As String
'get complete nntp message mnumber
End Function

Public Function get_article_as_CDO(mnumber As String) As CDO.Message
'gets complete NNTP artice as CDO object. Please enter a group before
End Function

Public Function get_newsbody(mnumber As String) As String
'get body of nntp message
End Function


Public Function get_newsheader(mnumber As String) As String
'get header of nntp message mnumber
'please note you need to choose a group before with
'enter_group
End Function


Public Function choose_next_message() As String
'moves pointer to next message on NNTP server and returns message
'number
'messageID of this next message can be read from nextmid
End Function

Public Function choose_message(mnumber As String) As String
'sets message point to mnumber on nntpserver. you need to enter a
'group before with enter_group
End Function

Public Function enter_group(group As String) As String
'enters group on nntp server
'newest message will be saved in lastnews
End Function

Public Function getgroups() As String
 'returns vbcrf seperated list of groups of nntp server
End Function

Public Sub slave()
'sends "SLAVE" command to newsserver
End Sub



Public Function send_command(custcommand As String) As String
'sends command to server and returns serveranswer
'works ONLY for answers fitting in one TCP packet
'ONLY FOR ADVANCED USER
End Function



Public Function get_cdo(mailnummer As String) As CDO.Message
 'returns CDO mail from mailbox
End Function

Public Function txt2cdo(messagestring As String) As CDO.Message
'creates CDO object out of message source as string
End Function



Public Sub write_to_disk(filepath As String, content As String)
'write (overwrite) file to disk
End Sub

Public Function post_nntp_message(nntp As CDO.Message, nntpserver As String, nntpport As String, nntpgroug As String, nntpfrom As String, nntpusername As String, nntppassword As String) As Boolean

End Function


Public Function cdo2txt(cdo_message As CDO.Message) As String
'returns Ascii source of CDO Object
End Function

Public Function post2nntp(ascmessage As String, changmid As Integer) As Boolean

End Function
