0

I want my app to send an email to myself when someone registers in my app.. I did use the code in this topic to manage this. Sending Email in Android using JavaMail API without using the default/built-in app

I don't get any errors but I also don't get any mails.. As you see below this is the code that is summoned after a button click.. Has any Idea what the problem might be..The Toast appears so the code in the try block got used but unfortunately not well ...

GMailSender sender = new GMailSender("myemailadress@gmail.com", "*********");
sender.sendMail("New user in App", "bodyyy","myemailadress@gmail.com","myemailadress@gmail.com");  
Toast.makeText(this, "mail sent", 200).show();

This are my properties. I tried it with 587 and 993 but no success. and yes my emailadress is a gmail :)

Properties props = new Properties();   
props.setProperty("mail.transport.protocol", "smtp");   
props.setProperty("mail.host", mailhost);   
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");   
Community
  • 1
  • 1
VanpeltJ
  • 21
  • 7

1 Answers1

1

Sending an email that way will allow someone who decompiles your APK to simply retrieve all of that private information. See: http://www.businessinsider.com/android-apps-give-away-secret-keys-2014-6

Instead use a service that allows users to register with, such as Facebook Login, Google+ Login, Parse, etc. Those services will handle all the authentication for you, and allow you to track user stats.

akadouri
  • 128
  • 6
  • Yeah I understand now that security is very important. But I don't know whether my problem will be solved with a Facebook Login or something. Maybe it will.. I really want users to register and know info about them like name, adress, email,.. This is very important 'cause my app needs to know who's registered and who's logged in for security and spam reasons.. If you know a nice way to let me handle this, let me know :) I'm going to inform myself a little bit more about getting this done! – VanpeltJ Aug 26 '14 at 19:50