2

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

the above solution to that question works perfect on the emulator but doesnt work on my ICS device. any reason for this or update fix that might have been introduced for ICS and up?

update: i got it to work by running the latest android os 4.1.2 and changing the manifest to min sdk version 7. i really cant explain why it started working that way. i tried both actual device and avd running build target 4.0.3 and it failed to send with no errors. changed it to the latest 4.1.2 and still nothing. gave up on that so went back to working on another activity but i couldnt run it on my device. i just changed the min sdk to 7 leaving the build target and before finishing for the day tried it again, it somehow worked. also, another change i did to the whole build was adding to the manifest. not sure if that or the minsdk was what fixed it but thought id include the changes.

Community
  • 1
  • 1
droopie
  • 441
  • 3
  • 12
  • 1
    "doesn't work" is a useless description of your symptoms. – CommonsWare Oct 16 '12 at 15:28
  • what else can i say? it doesnt work. it works fine on the emulator but not on the actual device using ICS. i dont get an error or anything because again, it works fine on the emulator. i dont know how else i can dumb it down for more than what the original post has. dont know if something is removed in ics or why its not working (if its an ics thing at all or a physical issue) – droopie Oct 17 '12 at 02:23
  • 1
    Show relevant code and share your server configuration if you want to get a useful answer. – Nikolay Elenkov Oct 17 '12 at 02:41
  • the code is exactly as how it is in the link from the original post. i am going to try it on jellybean to see if it works on that or it stops at gingerbread 2.3.3. i also ran it on avd 4.0.3 and it also doesnt send on that but does send on avd 2.3.3. im not changing it to imap or anything different, just trying to figure out the original code and why it doesnt work after 2.3.3. could just be removed from android completely or the code for it to work is different for newer android os, i dont know. – droopie Oct 17 '12 at 02:53
  • hey guys thanks for replying. even though you couldnt help me figure this out i somehow got it to work. either by adding or by changing the minsdkversion 7. either way, its working, and thanks for the replies. – droopie Oct 18 '12 at 02:02

2 Answers2

2

I had the same issue on my android version 4.0.3. Changing the min sdk version to 7 did the trick.

<uses-sdk android:minSdkVersion="7" />
Marijn
  • 10,367
  • 5
  • 59
  • 80
sara
  • 320
  • 1
  • 2
  • 11
  • i see you wrote "thanks droopie!" but got edited out. either way glad this was the issue and its working again! – droopie Jun 23 '13 at 17:34
0

Although it solved but I had the same problem that solved by using this part of the mentioned solution

I mean using AsyncTask which allows you to perform asynchronous work on your user interface. An AsyncTask will perform the blocking operations in a worker thread and will publish the results on the UI thread, without requiring you to handle threads and/or handlers yourself.

Community
  • 1
  • 1
forough
  • 47
  • 1
  • 1
  • 5