Stack Exchange
Sending mail without client Android
public class MainActivity extends Activity implements View.OnClickListener {

    Session session=null;
    ProgressDialog pdialog=null;
    Context context=null;
    EditText reciep,sub,msg;
    String rec,subject,textMessage;
    Button login;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        context = this;

        login = (Button) findViewById(R.id.btn_submit);
        reciep = (EditText) findViewById(R.id.et_to);
        sub = (EditText) findViewById(R.id.et_sub);
        msg = (EditText) findViewById(R.id.et_text);

        login.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        rec=reciep.getText().toString();
        subject=sub.getText().toString();
        textMessage=msg.getText().toString();

        Properties props=new Properties();
        props.put("mail.smtp.host","smpt.gmail.com");
        props.put("mail.smtp.socketFactory.port","465");
        props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
        props.put("mail.smtp.auth","true");
        props.put("mail.smtp.port","465");
        props.put("mail.smtp.socketFactory.port", "465");
        props.put("mail.smtp.socketFactory.class",
                "javax.net.ssl.SSLSocketFactory");
        props.put("mail.smtp.socketFactory.fallback", "false");
        props.setProperty("mail.smtp.quitwait", "false");

       session=Session.getDefaultInstance(props,new Authenticator(){
           protected    PasswordAuthentication getPasswordAuthentication()
           {
               return new PasswordAuthentication("example@gmail.com","password");
           }
        });

        pdialog=ProgressDialog.show(context,"","Sending mail....",true);
        RetreiveFeedTask task=new RetreiveFeedTask();
        task.execute();
    }

        class RetreiveFeedTask extends AsyncTask<String,Void,String> {


            @Override
            protected String doInBackground(String... strings) {

                try{
                    Message message=new MimeMessage(session);
                    message.setFrom(new InternetAddress("example@gmail.com"));
                    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(rec));
                    message.setSubject(subject);
                    message.setContent(textMessage,"text/html;charset=utf-8");
                    Transport.send(message);

                }catch (MessagingException e){
                    e.printStackTrace();
                }
                catch (Exception e){
                    e.printStackTrace();
                }


                return null;
            }

            @Override
        protected void onPostExecute(String result) {
            pdialog.dismiss();
            reciep.setText("");
            msg.setText("");
            sub.setText("");
            Toast.makeText(getApplicationContext(), "Message Sended", Toast.LENGTH_SHORT).show();
        }
    }





}

It shows a fatal exception. Can you help?
08-09 12:18:53.957 23203-23203/com.example.bathri.mail D/Dialog: show
08-09 12:18:53.979 23203-23323/com.example.bathri.mail E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
 Process: com.example.bathri.mail, PID: 23203
 java.lang.RuntimeException: An error occured while executing doInBackground()
     at android.os.AsyncTask$3.done(AsyncTask.java:304)
     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
     at java.lang.Thread.run(Thread.java:818)
  Caused by: java.lang.VerifyError: Rejecting class javax.mail.internet.MimeMessage because it failed compile-time verification (declaration of 'javax.mail.internet.MimeMessage' appears in /data/data/com.example.bathri.mail/files/instant-run/dex/slice-slice_4-classes.dex)
     at com.example.bathri.mail.MainActivity$RetreiveFeedTask.doInBackground(MainActivity.java:92)
     at com.example.bathri.mail.MainActivity$RetreiveFeedTask.doInBackground(MainActivity.java:85)
     at android.os.AsyncTask$2.call(AsyncTask.java:292)
     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
     at java.lang.Thread.run(Thread.java:818) 


The first thing you should do it, it´s to set a break point and follow it... I didn´t read your code, even someone could help you. But you need, if you want to be a programmer, to start using breakpoints and debug them.

i will use it ..but i am in need for solution form u  guys ...

So, which line is getting stopped? What is exception´s message in that point? We could start from there... @Bathri Nathan

all things are in the correct format but it shows FATAL EXception at Message message=new MimeMessage(session);
message.setFrom(new InternetAddress("example@gmail.com"));

if u have time try this code with adding jar files...   @EliasMP

First, your code is full of common JavaMail mistakes, you've obviously copied and pasted the code without understanding it.  See this Gmail example. Second, make sure you're using the JavaMail for Android release.  Finally, if it still fails, post the JavaMail debug output.

ya i got it. i am trying to understand it very well. i will post the working here soon  :-)  @BillShannon

Could i know how many Experiance u both people are in android ?  @EliasMP  and the billshannon
