This is a very small helper java library to easily build a JavaMail MIME object (javax.mail.internet.MimeMessage).
Messagefy is release by publishing in to the JCenter. So add the following configuration to your "build.gradle".
repositories {
...
jcenter()
}
Maven:
<dependency>
<groupId>com.vidolima</groupId>
<artifactId>messagefy</artifactId>
<version>1.1.1</version>
<type>pom</type>
</dependency>
Gradle:
dependencies {
compile 'com.vidolima:messagefy:1.1.1'
}
Example:
Messagefy messagefy = new Messagefy.Builder()
.from("sender@sender.com")
.to("vidolima@vidolima.com")
.subject("Messagefy")
.content("Hello Messagefy!")
.build();
javaMailSender.send(messagefy.getMailMessage());
Attribute | Type | Description |
---|---|---|
attachment | byte[] | The file to be attached to the message. |
attachmentMimeType | String | Attachment MIME type. |
attachmentName | String | Attachment name. Default name is "Untitled". |
ccList | Collection | List of "Cc" (carbon copy) recipients. |
content | String | The Message's content to a Multipart object. |
contentType | String | The Message's Content Type. Default content type is "text/html". |
from | String | The sender e-mail. |
senderName | String | The sender name. |
subject | String | The Message's subject. |
toList | Collection | List of "To" (primary) recipients. |
Messagefy is released under the terms of the MIT License.