jasp.smtp
Class NewMail

java.lang.Object
  extended byjasp.smtp.NewMail

public class NewMail
extends java.lang.Object

The NewMail object provides for sending a message with very few lines of code.


Constructor Summary
NewMail()
           
 
Method Summary
 void AttachFile(java.lang.String source)
          Adds an attachment to the message by reading a file
 void AttachFile(java.lang.String source, java.lang.String filename)
          Adds an attachment to the message by reading a file
 void AttachFile(java.lang.String source, java.lang.String filename, int encode)
          Adds an attachment to the message by reading a file
 void AttachURL(java.lang.String source, java.lang.String contentlocation)
          Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment
 void AttachURL(java.lang.String source, java.lang.String contentlocation, java.lang.String contentbase)
          Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment
 void AttachURL(java.lang.String source, java.lang.String contentlocation, java.lang.String contentbase, int encode)
          Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment
 java.lang.String getVersion()
           
 boolean Send()
          Attempts to send the email.
 void Send(java.lang.String from)
          sends the NewMail object to the specified recipients
 void Send(java.lang.String from, java.lang.String to)
          Sends the NewMail object to the specified recipients
 void Send(java.lang.String from, java.lang.String to, java.lang.String subject)
          Sends the NewMail object to the specified recipients
 void Send(java.lang.String from, java.lang.String to, java.lang.String subject, java.lang.String body)
          Sends the NewMail object to the specified recipients
 void Send(java.lang.String from, java.lang.String to, java.lang.String subject, java.lang.String body, int importance)
          Sends the NewMail object to the specified recipients
 void setBcc(java.lang.String bcc)
          Adds to the list of blind copy (Bcc) recipients for the NewMail object.
 void setBody(java.lang.String b)
          Sets the text of the NewMail object.
 void setBodyFormat(int b)
          Sets the text format of the NewMail object
 void setCC(java.lang.String cc)
          Adds to the list of copy (Cc) recipients for the NewMail object
 void setContentBase(java.lang.String cb)
          Sets a base for all URLs relating to the NewMail object's message body The ContentBase property is used for MHTML (MIME HTML) support.
 void setContentLocation(java.lang.String ct)
          Sets an absolute or relative path for all URLs relating to the NewMail object's message body The ContentLocation property is used for MHTML (MIME HTML) support.
 void setFrom(java.lang.String f)
          Sets the full messaging address to be used for the sender of this NewMail object.
 void setImportance(int i)
          Sets the importance associated with the NewMail object.
 void setItem(java.lang.String header, java.lang.String vl)
          Sets the value and contents of an additional header for the NewMail object.
 void SetLocaleIDs(int codepageid)
          Sets identifiers that define a messaging user's locale
 void setMailFormat(int m)
          The setting of the MailFormat property determines the default value for the EncodingMethod parameter in the AttachFile and AttachURL methods.
 void setPassword(java.lang.String pwd)
          Sets the password of the user name.
 void setRemoteHost(java.lang.String rh)
          Sets RemoteHost of the smtp server
 void setSubject(java.lang.String s)
          Sets the subject of the NewMail object as a string
 void setTo(java.lang.String to)
          Adds to the list of principal (To) recipients for the NewMail object
 void setUserName(java.lang.String name)
          Sets the user name of the smtp server.
 void setValue(java.lang.String header, java.lang.String vl)
          Sets the value and contents of an additional header for the NewMail object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewMail

public NewMail()
Method Detail

setBcc

public void setBcc(java.lang.String bcc)
Adds to the list of blind copy (Bcc) recipients for the NewMail object.


setBody

public void setBody(java.lang.String b)
Sets the text of the NewMail object.


setBodyFormat

public void setBodyFormat(int b)
Sets the text format of the NewMail object

Parameters:
b - the body format.
CdoBodyFormatHTML 0 The Body property is to include Hypertext Markup Language (HTML).
CdoBodyFormatText 1 The Body property is to be exclusively in plain text (default value).

setCC

public void setCC(java.lang.String cc)
Adds to the list of copy (Cc) recipients for the NewMail object


setContentBase

public void setContentBase(java.lang.String cb)
Sets a base for all URLs relating to the NewMail object's message body The ContentBase property is used for MHTML (MIME HTML) support. It represents the Content-Base header for the appropriate MIME body part. For more information on MHTML, see the RFC 2110 document.


setContentLocation

public void setContentLocation(java.lang.String ct)
Sets an absolute or relative path for all URLs relating to the NewMail object's message body The ContentLocation property is used for MHTML (MIME HTML) support. It represents the Content-Location header for URLs pertaining to the main body of a MIME message. ContentLocation corresponds to the ContentLocation property of a Message object.


setFrom

public void setFrom(java.lang.String f)
Sets the full messaging address to be used for the sender of this NewMail object.


setImportance

public void setImportance(int i)
Sets the importance associated with the NewMail object. The following values are defined:
Constant Value Description
CdoLow 0 Low importance
CdoNormal 1 Normal importance (default)
CdoHigh 2 High importance


setMailFormat

public void setMailFormat(int m)
The setting of the MailFormat property determines the default value for the EncodingMethod parameter in the AttachFile and AttachURL methods. However, if you add an attachment encoded in base 64 format, the value of the MailFormat property is automatically set to CdoMailFormatMime. For more information on Multipurpose Internet Mail Extensions (MIME), see the RFC 1341 document.


setSubject

public void setSubject(java.lang.String s)
Sets the subject of the NewMail object as a string


setTo

public void setTo(java.lang.String to)
Adds to the list of principal (To) recipients for the NewMail object


setValue

public void setValue(java.lang.String header,
                     java.lang.String vl)
Sets the value and contents of an additional header for the NewMail object


setItem

public void setItem(java.lang.String header,
                    java.lang.String vl)
Sets the value and contents of an additional header for the NewMail object. for example: NewMail("a1") = a1
NewMail.Value("a1") = a1


getVersion

public java.lang.String getVersion()

AttachFile

public void AttachFile(java.lang.String source,
                       java.lang.String filename,
                       int encode)
Adds an attachment to the message by reading a file

Parameters:
source - The full path and file name of the file to be attached to the message
filename - The file name to appear in the attachment's placeholder in the message. If FileName is not supplied, the file name from the Source parameter is used.
encode - The manner of encoding the attachment. The following values are possible:
EncodingMethod setting Value Description
CdoEncodingUUencode 0 The attachment is to be in UUEncode format (default).
CdoEncodingBase64 1 The attachment is to be in base 64 format.

AttachFile

public void AttachFile(java.lang.String source,
                       java.lang.String filename)
Adds an attachment to the message by reading a file


AttachFile

public void AttachFile(java.lang.String source)
Adds an attachment to the message by reading a file


AttachURL

public void AttachURL(java.lang.String source,
                      java.lang.String contentlocation,
                      java.lang.String contentbase,
                      int encode)
Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment

Parameters:
source - The full path and file name of the resource to be attached to the message.
contentlocation - The absolute or relative prefix for the URL that the rendering client can use to reference this attachment
contentbase - A base for the URL used to reference this attachment.
encode - The manner of encoding the attachment.

AttachURL

public void AttachURL(java.lang.String source,
                      java.lang.String contentlocation,
                      java.lang.String contentbase)
Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment

Parameters:
source - The full path and file name of the resource to be attached to the message.
contentlocation - The absolute or relative prefix for the URL that the rendering client can use to reference this attachment
contentbase - A base for the URL used to reference this attachment.

AttachURL

public void AttachURL(java.lang.String source,
                      java.lang.String contentlocation)
Adds an attachment to the message and associates a Uniform Resource Locator (URL) with the attachment

Parameters:
source - The full path and file name of the resource to be attached to the message.
contentlocation - The absolute or relative prefix for the URL that the rendering client can use to reference this attachment

Send

public void Send(java.lang.String from,
                 java.lang.String to,
                 java.lang.String subject,
                 java.lang.String body,
                 int importance)
          throws java.lang.Exception
Sends the NewMail object to the specified recipients

Throws:
java.lang.Exception

Send

public void Send(java.lang.String from,
                 java.lang.String to,
                 java.lang.String subject,
                 java.lang.String body)
          throws java.lang.Exception
Sends the NewMail object to the specified recipients

Throws:
java.lang.Exception

Send

public void Send(java.lang.String from,
                 java.lang.String to,
                 java.lang.String subject)
          throws java.lang.Exception
Sends the NewMail object to the specified recipients

Throws:
java.lang.Exception

Send

public void Send(java.lang.String from,
                 java.lang.String to)
          throws java.lang.Exception
Sends the NewMail object to the specified recipients

Throws:
java.lang.Exception

Send

public void Send(java.lang.String from)
          throws java.lang.Exception
sends the NewMail object to the specified recipients

Throws:
java.lang.Exception

setRemoteHost

public void setRemoteHost(java.lang.String rh)
Sets RemoteHost of the smtp server


setUserName

public void setUserName(java.lang.String name)
Sets the user name of the smtp server.


setPassword

public void setPassword(java.lang.String pwd)
Sets the password of the user name.


Send

public boolean Send()
             throws java.lang.Exception
Attempts to send the email.

Throws:
java.lang.Exception

SetLocaleIDs

public void SetLocaleIDs(int codepageid)
Sets identifiers that define a messaging user's locale