public class MailEncoder extends Object
example usage is:
MailMessage = new MailMessage();
(set elements and attachments ...)
String message = new MailEncoder(mailmessage).encode();
usually you are not using this class directly, rather it will be used by sendMail()
in MailClientImpl
Constructor and Description |
---|
MailEncoder(MailMessage message,
String hostname)
create a MailEncoder for the message
|
MailEncoder(MailMessage message,
String hostname,
MailConfig mailConfig)
Creates a MailEncoder for the message.
|
MailEncoder(MailMessage message,
String hostname,
String userAgent)
create a MailEncoder for the message
|
Modifier and Type | Method and Description |
---|---|
String |
encode()
encode the MailMessage to a String
|
EncodedPart |
encodeMail() |
String |
getMessageID() |
public MailEncoder(MailMessage message, String hostname)
The class will probably get a few setters for optional features of the SMTP protocol later e.g. 8BIT or SMTPUTF (this is not yet supported)
message
- the message to encode laterhostname
- the hostname to be used in message-id or null to get hostname from OS network configpublic MailEncoder(MailMessage message, String hostname, String userAgent)
The class will probably get a few setters for optional features of the SMTP protocol later e.g. 8BIT or SMTPUTF (this is not yet supported)
message
- the message to encode laterhostname
- the hostname to be used in message-id or null to get hostname from OS network configuserAgent
- the Mail User Agent name used to generate the boundary and Message-IDpublic MailEncoder(MailMessage message, String hostname, MailConfig mailConfig)
message
- the message to encode laterhostname
- the hostname to be used in message-id or null to get hostname from OS network configmailConfig
- the MailConfig used to encode the mail messagepublic String encode()
public EncodedPart encodeMail()
public String getMessageID()
Copyright © 2023 Eclipse. All rights reserved.