android - How to attach an image in sending an email -


i developing application prompt user input saved password , when input correct, class , activity terminated whenever inputs wrong, application send email saved email credential. achieved sending of email part problem don't know how let activity attach image email.i have tried codes not working. using gmailsender , gmail jar files have found in net.

                        new thread(new runnable() {                         @override                         public void run() {                             sharedpreferences sharedpreferences = getsharedpreferences("credentials", context.mode_private);                             string getemail = sharedpreferences.getstring("email", def);                             try {                                 gmailsender sender = new gmailsender("my.email@gmail.com", "mypassw0rd");     //                                  sender.addattachment(environment.getexternalstoragedirectory().getpath()+"/handsome.jpg");                                 sender.sendmail("sostracking mail", "your phone used @ " + add + ". google maps link is: " + tempadd + ".","sostracking.ph@gmail.com",getemail);                             } catch (exception e) {                                 toast.maketext(getapplicationcontext(),"error",toast.length_long).show();                             }                         }                     }).start(); 


Comments