i want to send email from my application,how can write code for send email from my application,have any setup for email?,anybody knows,please give sample code for me..
Thanks All
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can either use Android’s Intent system to launch the native email client on the phone. You can pre-populate the fields. User intervention is required to send the email.
Code would be something like:
You can also send attachments, see this thread for details.
EDIT:
Use
android.content.Intent.EXTRA_STREAMand pass to it the URI of your file image file.For e.g: if you have your a image file on your sdcard you can say:
If you want to send an email programmatically, without user intervention you can use the JavaMail port for Android. I haven’t tried it myself but see the following thread for details:
Sending Email using JavaMail