| Interface | Description |
|---|---|
| Enclosure |
Enclosure in MIME envelope.
|
| Envelope |
Envelope.
|
| Postman |
Postman.
|
| Protocol |
Mail network protocol.
|
| Stamp |
Stamp for a MIME envelope.
|
| Wire |
Wire used by a
Postman. |
| Class | Description |
|---|---|
| Envelope.Constant |
Envelope that always returns the same message (within one hour).
|
| Envelope.Draft |
Envelope that adds DRAFT flag to the message.
|
| Envelope.Mime |
Default envelope.
|
| Envelope.Safe |
Safe envelope that adds missing parts to the message.
|
| Envelope.Strict |
Strict envelope that fails if message is not valid.
|
| Postman.Default |
Default postman.
|
| Protocol.Smtp |
SNMP protocol.
|
| Protocol.Smtps |
SMTPS protocol.
|
| Token |
User signature to network node.
|
The best way to use it is to make an instance of
Postman.Default:
Postman postman = new Postman.Default(
new SMTP(
new Token("user", "password").access(
new Protocol.SMTP("smtp.gmail.com", 587)
)
)
);
postman.send(
new Envelope.MIME(
new Array<Stamp>(
new StSender("Yegor Bugayenko <yegor@jcabi.com>"),
new StRecipient("Jeff Lebowski <jeff@gmail.com>"),
new StSubject("dude, how are you?"),
new StBCC("my-boss@jcabi.com")
),
new Array<Enclosure>(
new EnPlain("Hi, long time no see! :) Check my pic!"),
new EnBinary(
new File("/tmp/picture.gif"),
"my-picture.gif",
"image/gif"
)
)
)
);
The only dependency you need is (check our latest version available at email.jcabi.com):
<depedency> <groupId>com.jcabi</groupId> <artifactId>jcabi-email</artifactId> </dependency>
Copyright © 2012–2017 jcabi.com. All rights reserved.