Class MailTransport
java.lang.Object
com.codename1.backend.mail.MailTransport
- Direct Known Subclasses:
SesTransport, SmtpTransport
One way of handing an encoded mail to something that will deliver it: an SMTP server, a provider's API.
A transport is given the envelope and the bytes and nothing else. It does
not queue, retry or keep anything; the server's Mailer does that around
it, the same way for every transport. It is called from the mail thread
and from any thread that calls MailSender.sendNow(Mail), so it is safe to call
from several at once.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes connections it holds.abstract StringgetName()What this transport is:smtp,ses,memory,log.booleanWhether the transport could reach its server the last time it tried.abstract voidHands one mail over, returning when the other side has taken it.
-
Constructor Details
-
MailTransport
public MailTransport()
-
-
Method Details
-
getName
What this transport is:smtp,ses,memory,log. -
send
Hands one mail over, returning when the other side has taken it.
Throws a
MailExceptionwhoseMailException.isPermanent()says whether trying again could help; any other IOException is taken to be a failure of the connection, and is retried.from: the address a bounce goes to, without a display namerecipients: the addresses to deliver to, without display namesmime: the whole message, CRLF line endings, not dot-stuffed
- Throws:
IOException
-
isHealthy
public boolean isHealthy()Whether the transport could reach its server the last time it tried. One that has not tried yet is healthy. -
close
public abstract void close()Closes connections it holds. Never throws.
-