简体   繁体   中英

how to send mail directly in android?

In my requirement i need to send a mail directly when user click on the send button without using intents.I have done it with java mail API.But it ask password.Can i send without giving my password?. Is it possible with any other ways? Please tell me.I used bellow link for sending mail.

http://androidcodeexamples.blogspot.in/2012/05/android-send-email-via-gmail-actually.html

Thanking in Advance.

To answer your question I first ask you one.. Can you send mail with any of the available acount without logging in with your password? the answer is no. Because before sending mail you need to authenticate your acount with password. So this is must. If you can send mail without password then anybody can do the same which is definitely not wanted.

You need to to authenticate to send mails. If you device already has applications you can use intents which will allow you the user to make a choice to sent mails using the desired application.

To send mails using intents

http://www.mkyong.com/android/how-to-send-email-in-android/

You can also hard code username and password and sent mails using javamail api.

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

The above requires users to have gmail account.

Can i send without giving my password?

Your mail server administrator is unlikely to allow password-less email sending, as soon a billion spammers will use your mail server.

You are welcome to write a Web service that will send email to your dedicated "contact-us" account. Or, have the Web service store the "contact-us" information elsewhere, such as a database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM