Skip to main content

Posts

Showing posts from October, 2013

Send mail from Android application without using default/built-in application

We know, We can send an e-mail using Intents, This will invoke either default mail app or built-in device mail apps to send an e-mail. This is unnecessary for user to work on e-mail application while he is trying to work an our application. So the question is how to send an e-mail from android application without user interaction? Answer is you can achieve this using JavaMail API . You have to use following three jars. mail.jar activation.jar additionnal.jar Complete code: MainActivity.java package com.exmple.javamail; import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import java.io.UnsupportedEncodingException; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail....