Basic Wrapper Library over Javax Mail API for Android. Sending email in background without user interaction. Only Gmail provider is supported.
dependencies {
compile 'com.github.kosmologist:Triangulum:v1.0'
}
Note: Add jitpack.io to root gradle file, in case you have not already configured jitpack
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
Triangulum triangulum = new Triangulum.Builder()
.setSenderEmail("lanister@github.com")
.setSenderPassword("fakePassword")
.setBody(htmlBodyString,ContentType.TEXT_HTML)
.setSubject("Triangulum | Test Subject")
.setAttachmentFilePath("absolute/path/to/file")
.addRecipient("johnsnow@gmail.com")
.addRecipient("robstark@gmail.com")
.onSuccess(new OnMailSuccess() {
@Override
public void onMailSuccess() {
textView.setText("Mail Sent");
}
}).onFailure(new OnMailFailure() {
@Override
public void onMailFail(String err) {
textView.setText("Failed to send mail, reason: " + err);
}
})
.build();
triangulum.sendEmail();
- Qasim