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.
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.
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.
Our organization has Lync as primary channel for IM. Now that everyone is about to get a mobile phone we need a way to have the custom mobile apps display presence and initiate chat sessions. It is almost the way Facebook client does it with Facebook Messenger.
I cannot find anything anywhere that shows how to any of those. I can deal w/o presence but it is a must to start the chat.
Note I don't want to go against UCWA and write another chat client. Lync for Android is good enough. I just need to figure out what the proper Intent and parameters are.
You could always open your Lync client by opening a URL that starts with the letters "lync://".
This URL scheme works just as well on iPhones.
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
I was wondering how to get the email from the owner of the phone or from the gmail account used on the phone.
I am trying to do this on android 1.6 and up.
I know its possible because I have seen some apps that get the email.
Maybe its undocumented or it reads it from a undocumented provider or some authentication service, but I know its possible.
Can anybody help me on this?
Thanks
Daniel
To retrieve information from another application you would use it's content provider.
The problem with what you want to do is that the gmail application is closed source and does not have documentation like the rest of the open source SDK. You could hack a solution together using undocumented providers like you said, but updates to the gmail application may break your code.
Either create your own email application using POP3 or IMAP and integrate with that, or think of a different way to do what you're looking to accomplish.