Package com.icegreen.greenmail.mail
Class MovingMessage
java.lang.Object
com.icegreen.greenmail.mail.MovingMessage
Contains information for delivering a mime email.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an address from which the email was sent.Retrieves the state object with the data used for authentication.jakarta.mail.internet.MimeMessageRetrieves the contents of the mail message, including all mail headers and the body.Retrieves the address from which the email was sent.Retrieves the addresses from which the email was sent.voidRemoves an address from the list of addresses from which the email was sent.voidsetAuthenticationState(AuthenticationState authenticationState) Retrieves the state object with the data used for authentication.voidsetMimeMessage(jakarta.mail.internet.MimeMessage message) Sets or overwrites the contents of the mail message, including all mail headers and the body.voidsetReturnPath(MailAddress fromAddress) Sets or overwrites the address from which the email was sent.toString()
-
Constructor Details
-
MovingMessage
public MovingMessage()
-
-
Method Details
-
getAuthenticationState
Retrieves the state object with the data used for authentication. CurrentlyPLAINandLOGINauthentication is supported. You can use this, for example, to retrieve the username or password that was sent by the client.Note that this will return
nullwhen no authentication was performed or needed.- Returns:
- The state used by the AUTH command, if any.
-
setAuthenticationState
-
getToAddresses
Retrieves the addresses from which the email was sent. Note that these are theRCPT TOaddresses from the SMTP envelope, not theTOaddresses from the mail header.- Returns:
- The address to which the mail is directed.
-
getMessage
public jakarta.mail.internet.MimeMessage getMessage()Retrieves the contents of the mail message, including all mail headers and the body.- Returns:
- The message that was sent.
-
getReturnPath
Retrieves the address from which the email was sent. Note that this is theMAIL FROMaddress from the SMTP envelope, not theFROMaddress(es) from the mail header.- Returns:
- The address from which the email was sent.
-
setReturnPath
Sets or overwrites the address from which the email was sent. Note that this is theMAIL FROMaddress from the SMTP envelope, not theFROMaddress(es) from the mail header.- Parameters:
fromAddress- The address from which the email was sent.
-
addRecipient
Adds an address from which the email was sent. Note that these are theRCPT TOaddresses from the SMTP envelope, not theTOaddresses from the mail header. -
removeRecipient
Removes an address from the list of addresses from which the email was sent. Note that these are theRCPT TOaddresses from the SMTP envelope, not theTOaddresses from the mail header. -
setMimeMessage
public void setMimeMessage(jakarta.mail.internet.MimeMessage message) Sets or overwrites the contents of the mail message, including all mail headers and the body.- Parameters:
message- The message that was sent.
-
toString
-