jasp.pop3
Class Mailer

java.lang.Object
  extended byjasp.pop3.Mailer

public class Mailer
extends java.lang.Object

J-ASP POP3 allows you to receive mail using the industry standard POP3 protocol in Java. Features include:


Constructor Summary
Mailer()
           
 
Method Summary
 void ClosePop3()
          Quits the current POP3 session and closes the connection.
 boolean Delete(int id)
          Permanently deletes the specified message from the server.
 boolean EraseFile(java.lang.String filename)
          Permanently deletes a file from the local drive.
 int getAttAchmentcount()
          Returns the number of attachements that were found within the message.
 boolean GetAttachmentInfo(int id)
          Gets the properties for the specified attachment and fill in the AttContentType, AttFileName and AttFileSize properties
 java.lang.String getAttContentType()
          Returns the ContentType for a message attachment after you call Mailer.
 java.lang.String getAttFileName()
          Returns the FileName for a message attachment after you call Mailer.
 int getAttFileSize()
          Returns the FileSize for a message attachment after you call Mailer.
 java.lang.String getBodyText()
          Returns the message text
 java.lang.String getCC()
          Returns any CarbonCopy addresses the message was sent to
 java.lang.String getDate()
           
 int getEncoding()
          Returns the encode of the message.
 java.lang.String getError()
          Returns any error message if a failure is detected by the component
 java.lang.String getExpires()
           
 java.lang.String getFromaddress()
          Returns The message originator's email address.
 java.lang.String getFromName()
          Returns The message originator's name.
 java.lang.String GetHeaderField(java.lang.String header)
          Queries the current message for any specific header field information.
 java.lang.String getMailDirectory()
           
 int getMessageCount()
          Returns the number of the messages are located on the server.
 java.lang.String getMessageID()
          Returns the MessageID header for the Retrieved message
 boolean GetPopHeader(int id)
          Allows you to retrieve the header information for one message instead of all messages.
 boolean GetPopHeaders()
          Provides a simple interface to retrieving information about each message on the server.
 int getPriority()
          Gets the message priority.
 java.lang.String getRecipients()
          Returns any To: addresses the message was sent to
 java.lang.String getRemoteHost()
          Gets the RemoteHost name or IP address
 boolean getReturnReceipt()
          Returns The ReturnReceipt flag.
 java.lang.String getSubject()
          Returns the Subject of the message that you have retrieved
 int getTimeout()
          Gets the maximum time to wait for a response from the POP3 server.
 java.lang.String getUserName()
          Gets the user name of the account on the POP3 server
 java.lang.String getVersion()
           
 boolean OpenPop3()
          Opens the connection to the POP3 RemoteHost using the UserName and Password properties.
 boolean Retrieve(int id)
          Rretrieves the entire message from the POP3 server including any attachments.
 boolean RetrieveToFile(int id, java.lang.String file)
          Pulls the message without processing anything.
 java.lang.String RetrieveToMemory(int id)
          Retrieves the specified message and returns the message in an unprocessed form.
 boolean SaveAttachment(int id)
          Saves an attachment to the MailDirectory's path.
 boolean SaveAttachmentToFile(int id, java.lang.String file)
          Saves an attachment to the MailDirectory's path.
 void setHtmlPartAsAttach(boolean flag)
          If flag is true, set the HTMLPart as an attachment.
 void setMailDirectory(java.lang.String m)
           
 void setPassword(java.lang.String pwd)
          Sets the password of the account on the POP3 server.
 void setPop3Log(java.lang.String log)
          You can debug a POP3 session by assigning a path and filename to the POP3Log property.
 void setRemoteHost(java.lang.String host)
          Sets the host name or IP address of the POP3 server you will be pulling messages from.
 void setTimeout(int t)
          Sets the maximum time to wait for a response from the POP3 server
 void setUserName(java.lang.String us)
          Sets the user name of the account on the POP3 server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mailer

public Mailer()
Method Detail

getAttContentType

public java.lang.String getAttContentType()
Returns the ContentType for a message attachment after you call Mailer.


getAttFileName

public java.lang.String getAttFileName()
Returns the FileName for a message attachment after you call Mailer.


getDate

public java.lang.String getDate()

getAttFileSize

public int getAttFileSize()
Returns the FileSize for a message attachment after you call Mailer.


getAttAchmentcount

public int getAttAchmentcount()
Returns the number of attachements that were found within the message.


getBodyText

public java.lang.String getBodyText()
Returns the message text


getCC

public java.lang.String getCC()
Returns any CarbonCopy addresses the message was sent to


getError

public java.lang.String getError()
Returns any error message if a failure is detected by the component


getEncoding

public int getEncoding()
Returns the encode of the message.


getExpires

public java.lang.String getExpires()

setHtmlPartAsAttach

public void setHtmlPartAsAttach(boolean flag)
If flag is true, set the HTMLPart as an attachment. Otherwise Ignore the htmlPart


getFromaddress

public java.lang.String getFromaddress()
Returns The message originator's email address.


getFromName

public java.lang.String getFromName()
Returns The message originator's name.


getMailDirectory

public java.lang.String getMailDirectory()

setMailDirectory

public void setMailDirectory(java.lang.String m)

getMessageCount

public int getMessageCount()
Returns the number of the messages are located on the server.


getMessageID

public java.lang.String getMessageID()
Returns the MessageID header for the Retrieved message


setPassword

public void setPassword(java.lang.String pwd)
Sets the password of the account on the POP3 server.


setPop3Log

public void setPop3Log(java.lang.String log)
You can debug a POP3 session by assigning a path and filename to the POP3Log property.


getPriority

public int getPriority()
Gets the message priority.


getRecipients

public java.lang.String getRecipients()
Returns any To: addresses the message was sent to


getRemoteHost

public java.lang.String getRemoteHost()
Gets the RemoteHost name or IP address


setRemoteHost

public void setRemoteHost(java.lang.String host)
Sets the host name or IP address of the POP3 server you will be pulling messages from.


getReturnReceipt

public boolean getReturnReceipt()
Returns The ReturnReceipt flag.


getSubject

public java.lang.String getSubject()
Returns the Subject of the message that you have retrieved


setTimeout

public void setTimeout(int t)
Sets the maximum time to wait for a response from the POP3 server


getTimeout

public int getTimeout()
Gets the maximum time to wait for a response from the POP3 server.


setUserName

public void setUserName(java.lang.String us)
Sets the user name of the account on the POP3 server.


getUserName

public java.lang.String getUserName()
Gets the user name of the account on the POP3 server


getVersion

public java.lang.String getVersion()

ClosePop3

public void ClosePop3()
Quits the current POP3 session and closes the connection.


Delete

public boolean Delete(int id)
Permanently deletes the specified message from the server.


EraseFile

public boolean EraseFile(java.lang.String filename)
Permanently deletes a file from the local drive. This is used to clean up messages that are written to disk using the RetrieveToFile method.


GetAttachmentInfo

public boolean GetAttachmentInfo(int id)
Gets the properties for the specified attachment and fill in the AttContentType, AttFileName and AttFileSize properties


GetHeaderField

public java.lang.String GetHeaderField(java.lang.String header)
Queries the current message for any specific header field information.


GetPopHeader

public boolean GetPopHeader(int id)
Allows you to retrieve the header information for one message instead of all messages. See GetPopHeaders to retrieve all message headers.


GetPopHeaders

public boolean GetPopHeaders()
Provides a simple interface to retrieving information about each message on the server. This makes it easy to present a list of message info.


OpenPop3

public boolean OpenPop3()
                 throws java.lang.Exception
Opens the connection to the POP3 RemoteHost using the UserName and Password properties.

Throws:
java.lang.Exception

Retrieve

public boolean Retrieve(int id)
Rretrieves the entire message from the POP3 server including any attachments. Once you have used Retrieve to get a valid message. J-ASP POP3 properties are filled in with the appropriate values and any attachments are available using the attachment methods/properties.


RetrieveToFile

public boolean RetrieveToFile(int id,
                              java.lang.String file)
Pulls the message without processing anything. The entire message including any attachments is saved to the file.


RetrieveToMemory

public java.lang.String RetrieveToMemory(int id)
Retrieves the specified message and returns the message in an unprocessed form.


SaveAttachment

public boolean SaveAttachment(int id)
Saves an attachment to the MailDirectory's path. SaveAttachment will attempt to determine the proper file name before saving.


SaveAttachmentToFile

public boolean SaveAttachmentToFile(int id,
                                    java.lang.String file)
Saves an attachment to the MailDirectory's path. SaveAttachmentToFile uses strFileName as the filename to save the message to.