|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Helper
com.noelios.restlet.ConnectorHelper
com.noelios.restlet.ClientHelper
com.noelios.restlet.ext.javamail.JavaMailClientHelper
public class JavaMailClientHelper
Client connector to a mail server. Currently only the SMTP protocol is
supported. To send an email, specify a SMTP URI as the ressource reference of
the call and use an XML email as the content of the call. An SMTP URI has the
following syntax: smtp://host[:port]
The default port used is 25
for SMTP and 465 for SMTPS. Use the Call.getSecurity().setLogin() and
setPassword() methods for authentication.
Sample XML email:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<email>
<head>
<subject>Account activation</subject>
<from>support@restlet.org</from>
<to>user@domain.com</to>
<cc>log@restlet.org</cc>
</head>
<body><![CDATA[Your account was sucessfully created!]]></body>
</email>
Constructor Summary | |
---|---|
JavaMailClientHelper(Client client)
Constructor. |
Method Summary | |
---|---|
static Request |
create(String smtpURI,
Representation email)
Creates a high-level request. |
static Request |
create(String smtpURI,
Representation email,
String login,
String password)
Creates a high-level request. |
void |
handle(Request request,
Response response)
Handles a call. |
Methods inherited from class com.noelios.restlet.ClientHelper |
---|
getClient, getContext, getLogger, getParameters |
Methods inherited from class com.noelios.restlet.ConnectorHelper |
---|
createContext, getProtocols, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaMailClientHelper(Client client)
client
- The client to help.Method Detail |
---|
public static Request create(String smtpURI, Representation email, String login, String password)
smtpURI
- The SMTP server's URI (ex: smtp://localhost).email
- The email to send (valid XML email).login
- Authenticate using this login name.password
- Authenticate using this password.public static Request create(String smtpURI, Representation email)
smtpURI
- The SMTP server's URI (ex: smtp://localhost).email
- The email to send (valid XML email).public void handle(Request request, Response response)
handle
in class ConnectorHelper
request
- The request to handle.response
- The response to update.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |