Reputation:
I want send image to server with your respective text.
I have challenge with class "Mail" , my server have WebMail(RoundCube), but I don't know how send image (bytes/transformText - > Image/etc.)
I use this class MAIL : To sender
http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android
private Mail m;
m = new Mail("[email protected]", "passtester");
String[] toArr = {"[email protected]"};
m.setTo(toArr);
m.setFrom("[email protected]");
m.setSubject("Subject");
m.setBody(""+ticket_id \n ""+Here put image[bytes?] );
I get correctly text, but I do not found guide to send image.
Thanks.
Upvotes: 1
Views: 97
Reputation: 18765
For sending the image along with text, firstly you can store your image some were locally and get the path and send it as an attachment with mail. i already achieved the same in my case.
There is two ways to achieve it.
Look into my answer here
You can use JavaMail API to handle your email tasks. JavaMail API is available in JavaEE package and its jar is available for download. Sadly it cannot be used directly in an Android application since it uses AWT components which are completely incompatible in Android.
This answer from Vinayak B may help you to solve your problem and if you face any problem follow this link too
Upvotes: 1