Email intent back to activity - android

Can anyone tell me how to redirect email intent's back button to activity where send mail button is present. I was succeeded to send mail from my android app by using email intent.But I want the flow to be exists only in my app without opening mail inbox. Can anyone help me?

If you want to send the email from your app you will have to implement IMAP or SMTP protocols in your application. There may be some third-party libraries available already
And if you're asking about behavior of the GMail app after it proceeds your intent, you can't alter it

Yes it is possible for that you have to build the Php backend(webservice) for sending email, in that you can put subject,recipient address and message with that webservice.

Related

send an email with content that can not be edited

I make an application that allows users to send an email. when i use the usual procedure to send an email with intents the user is redirected to gmail app, and he can edit the mail. I would like to prevent the user from modifying the content of the email. would anyone know how to do it please?
This is too long for a comment, so I am posting the answer. The short answer is that if you rely on the user's phone as the email client, then there is no guaranteed way to prevent the user from editing the email message, because the Gmail app is out of your control. So, what you should instead do here is to use a server side webapp to send the message instead. As an example, I have used an email service (e.g. HawkHost) on the server side behind an Android app to send the message. With this setup, you can completely control what message gets sent from the user or on behalf of the user.

Tracking if email was sent in another app

I am developing an app where the user can share via email (GMail app) or sms. Both methods will launch an external app that will do the work.
Since I am implementing tracking analytics that will be triggered when the email/SMS is sent, my question is how to send back or detect the status of sent email from GMail to my app. I know that it may sound like a stupid question, but I was wondering if this is possible.
how to send back or detect the status of sent email from gmail to my app
There is no requirement for the user to send the email, let alone for any email app (Gmail or otherwise) to let you know if the email was sent.
If the email is being processed automatically on some server, the server could use GCM or similar techniques to send a message to the device and your app indicating that the email was received.

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.
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.
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.

How can I check if emails can be sent from my phone?

I have an app that will send an email from the server if the app user does not have their email set up on their phone. Otherwise it will be sent through the android device.
What methods are there to check if email is configured on the phone?
Thanks
Another way to let the user to decide to send the email is to just create and use an Email Intent. That way the user sees that you want to send an email, and can choose what email client sends the email.
Example:
startActivity(new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:to#gmail.com"));

sending an email automaticlly

I have using some examples on this site to create an email class for sending a CSV file out to an email. It works find, sends the file correctly
The last line in the code reads
context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
This as far as I understand opens the email app and lets the user send the email. I was looking to see if it was possible to send the email automatically. ie without going to the email client and not leaving my app
Thanks for your time
sending mail using the javamail-api
see this post
Send auto email programmatically
Sending Email in Android using JavaMail API without using the default/built-in app

Categories

Resources