How to send email from background?

view story

http://stackoverflow.com – i know its duplicate question I tried using this code. try { GMailSender sender = new GMailSender("[email protected]","password"); sender.sendMail("This is Subject", "This is Body","[email protected]", "[email protected]"); Toast.makeText(MailDemoActivity.this, "mail Sent",Toast.LENGTH_SHORT).show(); } catch (Exception e) { Log.e("SendMail", e.getMessage(), e); } but it gives me following exception. 01-21 18:58:15.388: E/Mail Error(875): javax.mail.internet.AddressException: Illegal whitespace in address in string ``may be here to or from ser and test it'' i am not getting wh (HowTos)