I am creating an app that has only a single hard coded email address that will receive and respond to questions with the response. Only the body of the email would be necessary. It is being sent back to the app in plain text to be read, bypassing the email client picker.
My question is this: Is this even possible to do? I've searched high and low for the solution to this about 3 months now and even Google doesn't know the answer to this one.
Is it possible to receive the contents of an email message
You are certainly welcome to write your own POP3 or IMAP4 client, as you could for just about any operating system. You are also certainly welcome to see if there are any fringe email clients for Android that offer an on-device API that offers access to email messages.
Otherwise, no.
When it comes to receiving an email, it doesn't seem like anyone knows anything about how to do that.
That is because there is nothing much Android-specific about email. Email is not part of the operating system. Email is something provided by apps.
Related
I'm an android developer currently working on an app for the company I work for. In said application, we want to be able to export data from a Room database into a csv and send it out via email. My understanding has always been to not reinvent the wheel so when discussing this with my boss I recommended that it would be best to just use an intent to access an email application already on the device. He thinks this is "not user friendly" and "requires too many button clicks" (sidenote: He is not a programmer). He thinks we would be better off writing our own email code (Either using SMTP or HTTPS) so we can send emails with just one click.
Here is what I understand from my "research" on this topic:
Using an Intent:
Generally safer so long as the user is using a secure application
The user will feel more comfortable using an already known application
Puts less responsibility on us if something goes wrong emailing
Less code to support
Writing our own email code:
High chance of being insecure
User will probably not be comfortable entering their email credentials into a different app.
Requires writing a lot more code
Possibly faster
Obviously I'm very biased here. My opinion is simply that if you're not writing your own email application or writing something that uses a specific SMTP server (perhaps in an intranet) then there is absolutely no reason to do this.
However, I've come here because I want other peoples opinions especially if I'm lacking some knowledge and understanding here.
So I'm either going to get crucified for this or it'll be accepted as the honest, researched question it is...
How does one go about sending an email (with an image attachment) in Android (I'm using Kotlin but I'm fine with Java) without:
Intents - I don't want the user to see anything... It must just go in the background
GMail - Every single example/piece of code/tutorial I can find always talks about using GMail's SMTP... I don't want that. I want to input my own SMTP details so the email doesn't have to come from a GMail account and look rather unprofessional.
Yeah I've tried researching but as stated above, I keep finding the easy route (GMail). I'm relatively new to Android dev (years on iOS) so if there's an API or something I'm missing, please let me know :)
Thanks
Every single example/piece of code/tutorial I can find always talks about using GMail's SMTP... I don't want that. I want to input my own SMTP details so the email doesn't have to come from a GMail account and look rather unprofessional
Have your app contact your Web service, and have the Web service send the email on your behalf.
It's technically possible for you to use JavaMail and send SMTP directly from the client. This would require you to bake SMTP server information and user credentials into the app or to be able to download them from somewhere. Either will turn your SMTP server into a source of spam and related crap, as it will be easy for people to get at that information and use it to their own ends.
I am creating an app for android device and I was wondering if it is possible to connect my app with an e-mail account and have notifications every time the (let's say the gmail account) receives a new mail, and display the message in a new activity. I have researched a lot but I have not found something really useful.
Can anyone give me a clue on how to do it or even where to look for?
Yes. It is possible. You have to create an email client.
Here are some good email clients
You need to use the email client API for that. Here is Gmail API, you can find more my googling.
I'm having trouble understanding the top level of abstraction of this problem.
The Problem:
Users A and B download application X. A wants to send application-specific data to B. How does user A link with B?
My incredibly messy solution:
- User A clicks a button on the application that opens up a list of contacts. user A selects user B from the list. User B's email address was stored in A's address book. Application creates a sort of "share ID" and sends it to user B via that email address. User B's application gets that ID from the mail, then User A and B use the share ID to connect to a server and share between each other via the sserver.
There must be a better way? The two problems are:
1. It shouldn't need a server (should it? could it be free?)
2. There must be better ways of the users connecting to each other than sending ID's or links etc by gmail.
This solution should be so so simple, but I can't get my head round it. If this question is not sufficient to get a good answer, please please tell me what I need to do to get into the way of thinking about how mobile users can interract with each other as simply as possible, with as few clicks as possible, (Mobile 2.0 or whatever the modern day thing is!)
For example: A mother and a child have an android smart phone. They each download the "ChildLeash" app. Child wishes to configure the app to send updates to Mother, so that Mother can keep track of Child's location and so on. The problem is some how Child needs to tell the app what location Mother is at for the data to be sent to. What is a user-friendly way for Child to Identify Mother's phone? (Mother's IP address? Phone number? Email address? OpenIDs? NFC/Bluetooth?) So that it can then communicate?
You could use push notifications, as provided by the Android Cloud to Device Messaging Framework. There's an Android blog post about this. Problem is, this seems beta and not yet available to all developers (you need a specific signup).
Regarding "IP Adresss", P2P and such, this generally won't work. See: Is peer-to-peer communication over 3G/4G possible for smart phones?
If messages are not urgent, then you could use AlarmManager to have your app wake up every hour or so, and check for new messages by connecting to a server. Not sure that would work for your "ChildLeash" example. Another similar solution would be to use a Service to poll the server.
Usually this sort of interaction would require a server. Which you've kind of faked using email as your medium.
It might be worth looking into peer to peer libraries such as JXTA. There's an android port here: http://code.google.com/p/peerdroid/
EDIT: I just came across this: http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html Which looks like exactly what you're after.
we have an application that need to interact with mail.
For that, our customer want us to :
- Retrieve the Activesync parameters the user have entered on the general parameters of the phone.
- Send the mail in a silent way using these activesync parameters.
- Be able to read and parse a possible reply to the mail on the Exchange server.
I know that it may cause severe security issue (retrieve a private password from an application is not a good practice..), but i can't find any clue on the sdk to communicate and send mail via activesync.
If anyone have some informations, i would be glad to hear about it.
Thanks a lot
Antoine
So, you want to send the email without any user intervention (in the background)?
Check out this article:
http://jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android