How to send email in Android
Sending email in android is not really an easy task, but with using Maildroid library it takes seconds
Library
https://github.com/nedimf/maildroid/
Libary got great attraction on r/androiddev so here it is how it works ♥️
Start
Add this to your root.gradle file
allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
Add dependency
dependencies {
            implementation 'com.github.nedimf:maildroid:0.0.1'
          }
Adding Maildroid to your app
  MaildroidX.Builder()
            .smtp("") //Add your smtp provider
            .smtpUsername("") 
            .smtpPassword("")
            .smtpAuthentication() //true
            .port("")
            .type(MaildroidX.HTML) //Type of email
            .to("")
            .from("")
            .subject("")
            .body("")
            .onCompleteCallback(object : MaildroidX.onCompleteCallback{
                override fun onSuccess() {
                    //Place for your code when email is sent successfully!
                }
                override fun onFail() {
                   //Place for your code when email is not sent!
                }
            },3000)
            .mail()
Testing
Create account on [mailtrap](https://mailtrap.io/ to test your emails. T
Add username and password in those constructor field.
    
Top comments (0)