Esri Geoportal Server
1.0

com.esri.gpt.framework.mail
Class MailRequest

java.lang.Object
  extended by com.esri.gpt.framework.mail.MailRequest

public class MailRequest
extends Object

A simple client for sending SMTP based E-Mail messages.


Field Summary
static String MIMETYPE_HTML
          Mime type - HTML, "text/html; charset=UTF-8"
static String MIMETYPE_PLAIN
          Mime type - plain, "text/plain; charset=UTF-8"
 
Constructor Summary
MailRequest()
          Default constructor.
MailRequest(Authenticator authenticator)
          Constructs with an authenticator if crendentials are required by the mail server.
 
Method Summary
 String getBody()
          Gets the body.
 String getFromAddress()
          Gets the from E-Mail address.
 String getHost()
          Gets the host.
 String getMimeType()
          Gets the Mime type.
 int getPort()
          Gets the port.
 StringSet getRecipients()
          Gets the recipients.
 String getSubject()
          Gets the subject.
 String getToAddress()
          Gets the to E-Mail address.
 void send()
          Sends the E-Mail message.
 void setBody(String body)
          Sets the body.
 void setFromAddress(String address)
          Sets the from E-Mail address.
 void setHost(String host)
          Sets the host.
 void setMimeTypeHtml()
          Sets the Mime type to text/html.
 void setMimeTypePlain()
          Sets the Mime type to text/plain.
 void setPort(int port)
          Sets the port.
 void setSubject(String subject)
          Sets the subject.
 void setToAddress(String address)
          Sets the to E-Mail address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIMETYPE_HTML

public static final String MIMETYPE_HTML
Mime type - HTML, "text/html; charset=UTF-8"

See Also:
Constant Field Values

MIMETYPE_PLAIN

public static final String MIMETYPE_PLAIN
Mime type - plain, "text/plain; charset=UTF-8"

See Also:
Constant Field Values
Constructor Detail

MailRequest

public MailRequest()
Default constructor.


MailRequest

public MailRequest(Authenticator authenticator)
Constructs with an authenticator if crendentials are required by the mail server.

Parameters:
authenticator - the authenticator
Method Detail

getBody

public String getBody()
Gets the body.

Returns:
the body

setBody

public void setBody(String body)
Sets the body.

Parameters:
body - the body

getFromAddress

public String getFromAddress()
Gets the from E-Mail address.

Returns:
the from address

setFromAddress

public void setFromAddress(String address)
Sets the from E-Mail address.

Parameters:
address - the from address

getHost

public String getHost()
Gets the host.

Returns:
the host

setHost

public void setHost(String host)
Sets the host.

Parameters:
host - the host

getMimeType

public String getMimeType()
Gets the Mime type.

Returns:
the Mime type

setMimeTypeHtml

public void setMimeTypeHtml()
Sets the Mime type to text/html.


setMimeTypePlain

public void setMimeTypePlain()
Sets the Mime type to text/plain.


getPort

public int getPort()
Gets the port.

Returns:
the port

setPort

public void setPort(int port)
Sets the port.

Parameters:
port - the port

getRecipients

public StringSet getRecipients()
Gets the recipients.

Returns:
the recipients

getSubject

public String getSubject()
Gets the subject.

Returns:
the subject

setSubject

public void setSubject(String subject)
Sets the subject.

Parameters:
subject - the subject

getToAddress

public String getToAddress()
Gets the to E-Mail address.

Returns:
the to address

setToAddress

public void setToAddress(String address)
Sets the to E-Mail address.
The address is used to immediately set the recipients. The address string is tokenized with delimiters:
semi-colon comma space

Parameters:
address - the to address

send

public void send()
          throws AddressException,
                 MessagingException
Sends the E-Mail message.

Throws:
AddressException - if an E-Mail address is invalid
MessagingException - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.