The iASP_NNTP component lets you platform independently
retrieve and post articles to standard NNTP (Usenet/News) servers. iASP_NNTP
contains different types of properties and methods.
Following steps are required in order to communicate with network news
server using AspNNTP.Conn class:
The following code demonstrates how to use iASP_NNTP from VBScript.
In this example we'll retrieve the first ten articles available on the
msnews.microsoft.com server from the newsgroup named microsoft.public.inetserver.misc.
Methods |
Description |
void setServer(String NNTPServer) |
It establishes the connection with the NNTP server at 119 port and
sets server and connected property. |
String getServer() |
It returns the name of server, which is currently connnected. |
boolean setNewsgroup(String newsgroup) |
It sets the existing Newsgroup.
Note:- server property must be set first. |
void setBodyText(String bodyText) |
It sets the bodyText property with the specified string. |
String getBodyText() |
It gets the bodyText property. |
getArticleByNumber(int ) |
It retrieves the article from NNTP Server by number and set the
related properties. |
void setTimeout(int seconds) |
Timeout is the maximum Time that iASP_NNTP waits to get a response
from the remote site. The default is 45 seconds.
Note:- Set the TimeOut in milliseconds. |
int getTimeout() |
It returns Timeout. |
final String getAlias(); |
It returns the alias as "IASPNntp.Conn" |
String getUserName() |
It returns the name of user for NNTP Server. |
void setFromName(String) |
It sets article originator’s name. |
String getFromName() |
It returns article originator’s name.. |
void setFromAddress(String) |
It sets article originator’s email address. |
String getFromAddress() |
It return article originator’s email address. |
void setOrganization(String) |
It sets organization name of the sender. |
String getOrganization() |
It returns organization name of the sender. |
void setSubject(String ) |
It sets the subject of an article to be posted. |
String getSubject() |
It gets the subject of the current article. |
void setUserName(String) |
It sets the name of the user for NNTP Server. |
String getMessageID() |
It gets the messageID of the current article . |
boolean isConnected() |
It returns the status of the connected property . |
void setSuppressMsgBody(boolean) |
It sets the suppressMsgBody to be true or false depending if the
bodyText of the retrieving article has to be saved or not . |
boolean isSuppressMsgBody() |
It returns the status of the suppressMsgBody property . |
void setGroups(String) |
It sets the group(s) to which the article needs to be posted. |
String getGroups() |
It returns the groups property. It specifies which newsgroup or
newsgroups the current article belongs to. |
String getResponse() |
It returns the last Response which is send by the server. |
void setPGPPath(String) |
It sets the path where PGP (Pretty Good Privacy) is located. |
void setPGPParams(String) |
It sets the PGPParams by the user. |
String getPGPParams() |
It returns the PGP parameters . |
String getPGPPath() |
It returns the path where PGP is located . |
void setPassword(String) |
It sets the password property for server authentication. |
String getPassword() |
It returns the password property value, which is set for authentication. |
void setTimeOut(int) |
It sets the maximum time that iASP_NNTP should wait to get
a response from the remote server. |
int getTimeOut() |
It returns timeout . |
void setFollowUpTo(String) |
It sets the list of the newsgroup(s) to which the article is to
be posted. |
String getFollowUpTo() |
It returns the list of newsgroup(s) to which the current article
is posted. |
void setReferences(String) |
It sets the message ID's of any articles prompting for submission
of the article. |
String getReferences() |
It returns the references of an article. |
void setReplyTo(String) |
It sets the author name. Mailed replies to the author should be
sent to the name specified. |
String getReplyTo() |
It returns author name as replyTo property. |
boolean isWordWrap() |
It returns the status(true or false) of wordWrap . |
void setWordWrapLen(int) |
It sets the length of the wrapping characters by the user.
By default wordWrap length is 70. |
int getWordWrapLen() |
It returns the length of the wrapping characters. |
String getVersion() |
It returns the version of the component. |
void setCharSet(int) |
It sets the character set used by the article. By default CharSet
is US Ascii.
Valid values:
1 = US Ascii
2 = ISO-8859-1 |
int getCharSet() |
It returns the character set used by the current retrieved
article . |
void setCustomCharSet(String) |
It sets the custom CharSet if one wish to use an alternate
CharSet . |
String getCustomCharSet() |
It returns the CustomCharSet used by the article . |
void setEncoding(int) |
It sets the encoding type for attachments to be send. The default
setting is MIME.
Valid values:
1 = UUEncoded
2 = MIME |
int getEncoding() |
It retrieves the encoding type of the current attachment. |
void setDistribution(String) |
It sets the distribution property whenever the article is ready
for posting . This optional property is used to alter the distribution
of the message. |
String getDistribution() |
It retrieves the distribution property of the current article . |
int getLines() |
It retrieves the number of lines from the headers of the currently
retrieved article. |
void setContentType(String) |
It sets the content type of the BodyText of the article to
be posted. |
String getContentType() |
It returns the content type of the BodyText of the current article
. |
String getAttFileName() |
It returns the name of file attached with the recently retrieved
article. |
String getAttContentType() |
It returns the content type of the attachment of the retrieved article
. |
int getAttFileSize() |
It returns size of file attached with the retrieved article. |
int getAttachmentCount() |
It returns the number of attachement(s) with the recently
retrieved article. |
void setAttachmentDirectory(String) |
It sets the path to which attachment should be saved. |
String getAttachmentDirectory() |
It returns the attachmentDirectory property in order to specify
where attachments will be written when the saveAttachment()
method is called. |
void setExpirationDate(String) |
It sets a suggested expiration date for the article to be
posted. It must be in a legal USENET date format |
String getExpirationDate() |
It returns suggested expiration date for the article. |
String getExpires() |
It returns date,after which component should not be valid for functionality. |
void setDateTime(String) |
It sets the current date and time whenever article is ready for
posting. The date should have the following format
Weekday, DD-Mon-YY HH:MM:SS TIMEZONE |
String getDateTime() |
It returns the date and time of the article posting. |
int getCurrentArticle() |
It returns the article number of the given Newsgroup |
int getFirstArticle() |
It returns the first Article number of the specified newsgroup. |
int getLastArticle() |
It returns the last article number. |
int getTotalArticles() |
It returns the total number of articles present in the given newsgroup
. |
void setNNTPLog(String) |
It sets the Log file name which saves all operations and responses
send by the NNTP server. |
String getNNTPLog() |
It returns the NNTPLog file name. |
boolean nextArticle() |
It advances the current Article pointer by one and returns true
if it makes the increment successfully in the pointer; otherwise false
will return. |
boolean previousArticle() |
It recedes the current Article pointer by one and returns true if
it makes the decrement successfully in the current pointer; otherwise
false will return. |
boolean saveNewsgroupList(String) |
This method attempts to save the list of existing newsgroups in
the specified file. |
boolean getAllNewsgroups(String) |
This method attempts to get the list of newsgroup either from the
specified file when the file name is not null or from the server
when the input parameter is void. |
void prepareToPost() |
This method attempts to reset the properties before posting. |
boolean addExtraHeader(String) |
This method attempts to add an extra header to the headers of the
current article.
NNTP.addExtraHeader ("HeaderName: HdrValue") |
void clearExtraHeader() |
This method clears all extra headers that were added by the addExtraHeaders(). |
String getHeaderField(String) |
This method attempts to extract the headers which are not parsed
before. This will enable the user to pass the required field to this
method. If it is present in the internal extraHeader property
it will retrieve the value of that field, otherwise null will return. |
String[] getAllNewsgroups() |
It retrieves the list of existing newsgroups from the server. |
boolean getAttachmentInfo(int) |
It retrieves the information related to the specified
attachment with the current article. It also initializes the
local properties related to an attachment like attContentType,attFileName
etc. |
boolean saveAttachment(int) |
It saves the specified attachment to the attachmentDirectory
if it is set using setAttachmentDirectory(); otherwise to the root. |
void clearAttachments() |
It clears all attachments of the current article. |
boolean addAttachment(String) |
It adds attachment to the current article. |
void clearBodyText() |
It clears the bodyText of the current article. |
boolean getArticleByNumber(int) |
It retrieves the article by giving its number.
It also initializes the properties related to that article.
It returns true if the article is retrieved successfully and false
otherwise.
ResponseCode for this action is 220. |
boolean getArticleHeaders() |
It retrieves the headers of the current article and
returns true if the header is retrieved successfully and false otherwise. |
boolean getBodyTextFromFile(String,
boolean, boolean) |
It gets the text from the specified file and fills it to the bodyText
property of the article to be posted.
First param is the name of file whose content is to be read.
Second param is the true or false depending whether the file can be
erased or not after filling the bodyText of the article.
Third param shows window status.
This method returns true if the file is successfully read and
false otherwise. |
boolean getArticleByID(String) |
It retrieves the article by giving its messageID.
It also initializes the properties related to that article.
It returns true if the article is retrieved successfully and false
otherwise. |
String getNextArticleHeaders(int) |
It retrieves the multiple headers of the next articles.
The input param specify the number of headres to be retrieved. |
boolean postArticle() |
It posts the new article to the current Newsgroup .
It works only when the posting is allowed to that newsGroup.
ResponseCode for this action is 314. |
If you require technical support please send complete details about the
problem you are having to support@halcyonsoft.com.