0

I am developing an android application in which i struggled with this thing, Need to send a email from my application in background without any UI from the account which the user sync in android device. Need some ideas. Thanks

Chris
  • 1,271
  • 2
  • 15
  • 35
  • take a look at this thread http://stackoverflow.com/questions/2197741/how-to-send-email-from-my-android-application – Yngwie89 Oct 31 '12 at 11:37

1 Answers1

0

You can use JavaMail API to handle your email tasks. JavaMail API is available in JavaEE package and its jar is available for download. Note it cannot be used directly in an Android application since it uses AWT components which are incompatible with Android. So you need to use the android port for this:

You can find the Android port for JavaMail here:

http://code.google.com/p/javamail-android/

Add the jars to your application and use the SMTP method.

See this thread for an example on how to do this:

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

There is no way to send an email silently, without either:

  • letting the user know and accept it first (by using intents and an email provider)

  • asking for the username and password before and using an email API as above (the user will implicitly give you the approval to send/receive emails by entering those values)

This design is for security reasons and is unlikely to change.

There is a project underway to allow you to do this but it is not probably mature yet and I wouldn't advise it. here's the link:

https://code.google.com/p/google-authenticator-for-android/

Community
  • 1
  • 1
Anup Cowkur
  • 19,813
  • 6
  • 48
  • 82
  • Thanks for ur answer anup, but i want to send mail without prompting user to give their password, JavaMail API requires password. Is there anyother way to achieve this. – Chris Oct 31 '12 at 08:38