Q: Sending Email in Android using JavaMail API without using the default/built-in app

Test Case #3


File ID: #2033124-2-cc


   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;
            }
        });
    }
}

    

  1. For those complaining/asking about how to get user's password - that's not the idea here. This is meant to be used with your (developer's) e-mail account. If you want to rely on user's e-mail account you should use the e-mail intent, which is widely discussed in other posts.
  2. You have a problem in GMailSender.sendMail(). The problem is that no errors go outside of sendMail because you have try..catch inside it surrounding all the code. You should remove try..catch from sendMail. Otherwise it's impossible to detect errors
  3. Considering how easy it is to reverse engineering an APK package, do you think this is a safe approach? I mean, storing a password in plain text doesn't sound too good to me...

Comments Quality
Accurate?:
Precise?:
Concise?:
Useful?: