3

I know there are some topics about this and some solution but it is not working for me...

I had try Sending Email in Android using JavaMail API without using the default/built-in app the most voted, there is no error but no email too :(

Can you help me with the code?

i have a button and when i click it i want the device to send the email. I am running the software on my android device, not on the emulator (HTC One S - Android 4.0.4 Stock)

I will appreciate your help! Thanks!

Community
  • 1
  • 1
ibancioiu
  • 31
  • 6
  • 1
    If you would be so kind to explain *why* it doesn't work it will be much *much* easier for anyone to help you. Do you get any exception, compile time errors, runtime errors, does the app just crash? There's a few try-catch with empty catch handlers in the top voted answer on that page, have you tried adding a handler that displays an exception if it occurs? – Patrick Nov 03 '12 at 08:34
  • 1
    **it is not sending the email :(** – ibancioiu Nov 03 '12 at 09:02
  • Well, then I can't help you. If you want more tips on how to explain your problems (other than "It won't work") please read [Writing the perfect question](http://tinyurl.com/so-hints) – Patrick Nov 03 '12 at 09:10
  • it dosen't crush it dosen't do anything, not freezeing :(, this is the problem (sorry for my english) – ibancioiu Nov 04 '12 at 09:14
  • That's why I asked you to catch the exceptions in the catch handlers. If the application doesn't throw any exceptions, it will be very difficult to help from the description "it doesn't do anything". – Patrick Nov 04 '12 at 15:35
  • i don't understand what you need, but i had try to add finish(); in try{...} and in works (the program is closing), the same with catch(...){....} EDIT: can you create a project in eclipse an run it and send it on ibancioiu@fedoraproject.org to compare the code... i don't know what is wrong with the code, just changed the username and password in MailSenderActivity.java :| – ibancioiu Nov 06 '12 at 17:23
  • You can remove the try catch handlers altogether, at least then the application will crash. In order for you to know what the problem is you need to catch the errors and *display* them! An empty catch handler will not display an error if it occurs, so you won't know what went wrong. Please read a tutorial on how exception handling works. And **no**, I won't create a project and do it for you. – Patrick Nov 06 '12 at 20:38
  • See below link for complete example of send mail using Java API. [Android – Send Email Via GMail (Actually Via SMTP)](http://androidcodeexamples.blogspot.in/2012/05/android-send-email-via-gmail-actually.html) – Dipak Keshariya Nov 03 '12 at 08:29
  • :(( not working the same problem – ibancioiu Nov 03 '12 at 09:01
  • @ibancioiu post full error logcat. – Dipak Keshariya Nov 03 '12 at 09:02
  • there is no error, just warning.. 11-03 10:53:06.711: W/IInputConnectionWrapper(14658): showStatusIcon on inactive InputConnection 11-03 10:53:06.711: W/IInputConnectionWrapper(14658): InputConnection = com.android.internal.widget.EditableInputConnection@40e5e6f8, active client = false – ibancioiu Nov 03 '12 at 09:03
  • ok, can you create a project in eclipse an run it? If it works just attach it and i will try id, i don't know what to do, because it isn't working :( – ibancioiu Nov 03 '12 at 19:53
  • See here to [Send mail from Android application without using default/built-in application](http://v4all123.blogspot.in/2013/10/send-mail-from-android-application.html) – Gunaseelan Oct 07 '13 at 05:21

0 Answers0