i would like to send an email with an attachment (image). I am using a background service and there should be no intent. Now i am looking for the best solution. I thought about the JavaMail API, but i am not sure if this would be the best solution. Another option might be the upload of the image and the usage of a php script to send the mail. Is this a good idea because of the traffic for the upload?
Asked
Active
Viewed 631 times
0
-
1Have you thought about using something like the [Amazon SES](https://developer.amazon.com/post/TxEUZC89WLEC2Z/Sending-E-mail-with-Amazon-SES-Using-the-AWS-SDK-for-Android.html)? – Aaron McIver Jun 21 '13 at 20:40
1 Answers
0
Sending the mail without popup/user interaction is possible with JavaMail. I tried it myself. There is a lot of good documentation for that. I think it doesn't matter if you send the image by mail or upload it somewhere or use some other solution. The traffic will be in all cases the same because of the same filesize. If you want to reduce the traffic you can zip the image, reduce quality...

B770
- 1,272
- 3
- 17
- 34
-
I tried the following code, but i do not get a mail or error message. http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a It is also JavaMail. – JavaForAndroid Jun 21 '13 at 20:53
-
-
Yes, i did. I do not know if the topic is outdated because it is quite old. – JavaForAndroid Jun 21 '13 at 21:02
-
JavaMail is old but still working. Have you added the 3 .jar files to build path? Have you tried to log your code. Perhaps there is no error but some notifications in your logcat? – B770 Jun 21 '13 at 21:05
-
-
nothing in your spam? perhaps this will help: http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/ – B770 Jun 21 '13 at 21:26
-
I checked Spam folder as well. I will take a look at your link. – JavaForAndroid Jun 21 '13 at 21:44
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/32188/discussion-between-javaforandroid-and-b770) – JavaForAndroid Jun 21 '13 at 21:44