Sending Email in Android without using the default / built-in app

It is very easy to programmatically send email without using default email application in android. We can send email by using gmail, hotmail, yahoo or your domain email like info@wisdomitsol.com

In comming example I will show you exact code to send email programmatically using android code. Before continue download following jar files and include these libarares into your android project.

activation.jar

mail.jar

additionnal.jar

How to add external jar file in eclipse

Now create a class GMailSender.java

Note: You can change port accourding your requirement. Port could be 465 or 587

We must change mail host accouring to sender email.

For your own domain it could be smtp.yourdomain.com

Now create other class JSSEProvider.java

How to send email from your activity, button click or from background service etc.

You can use AsyncTask to send email.

Don’t forget to add internet permission in AndroidManifest.xml