public class MailSenderActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.suggestions); final Button send = (Button) this.findViewById(R.id.subscribe); send.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub try { GMailSender sender = new GMailSender("username@gmail.com", "password"); sender.sendMail("This is Subject","This is Body","user@gmail.com","user@yahoo.com"); } catch (Exception e) { Log.e("SendMail", e.getMessage(), e); } } }); } } public final class JSSEProvider extends Provider { public JSSEProvider() { super("HarmonyJSSE", 1.0, "Harmony JSSE Provider"); AccessController.doPrivileged(new java.security.PrivilegedAction() { public Void run() { put("SSLContext.TLS","org.apache.harmony.xnet.provider.jsse.SSLContextImpl"); put("Alg.Alias.SSLContext.TLSv1", "TLS"); put("KeyManagerFactory.X509","org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl"); put("TrustManagerFactory.X509","org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl"); return null; } }); } }
GMailSender.sendMail()