I want to send a User an email or SMS to his SmartPhone when an Alert happens on his desktop App.
How can I send an email WITHOUT supplying my log-in credentials within the App?
using smtp I need to provide my credentials, but as this is for a published application that does not sound like a good idea.
I understand this is a very general question, but I am having trouble finding a solution on the web.
I'm sorry, but you will not be able to do this, as the smtp server requires some sort of authentication, from which to send from
Related
I have a running and working implementation of the Java Mail API. I am using the api to send out bulk email messages. On some occasions, the login gets blocked by google. So, I go to my gmail account and allow access to apps and set the security level to give access to apps that don't use what google calls "modern security". So, the google page tells me to try my program again. I try it again and it still won't let me log in. On some occasions when I have a login fail, I can go to the account, log in, and type in the recaptcha. This will allow me to log back in shortly after and send emails. However, the problem I am now experiencing does not show any recaptcha, nor does it say anything about any unknown apps that tried to access the account. It says nothing, and just wont let me log in to my account. I created two new accounts for testing and they worked fine. The account that I created that doesn't work only allowed me to send 17 emails before it blocked my service. Does anyone have any suggestions? Thanks!
Go to your Gmail account setting page and Enable access of Less secure apps. Then try with Java Mail API. Hope it works for you.
Make sure that your JavaMail with google auth is working fine, Check concurrently with Different app. If not post your code
If you're using a free Gmail account, Google might think your bulk email is spam (duh). If you're going to send bulk email, it may be time to pay someone for a business account that will let you do that.
I'm currently developing an android app where the user has to fill out and successfully send the data of a few text fields to a recipient/server, to enable a feature.
The big issue is how to do that in a secure way to be protected against e.g. decompiling. My concern is not the security during the transport but rather the security of the transport medium.
What I've thought/read so far:
I could send the data via mail with the Java Mail API.
First of all, I don't want require that the user has to enter his mail credentials and SMTP server.
That would mean that I have to include the credentials to a mail account in the app, though.
To avoid the situation that somebody decompiles the app and takes over my mail account, I thought of encrypting methods, but even if I would save the aes encrypted version of the password, the attacker could decompile the app and could add a syso to output the decrypted password.
The same applies to OAuth authentication because I have to store an authentication token.
In addition to the mail version, I read something about getting the password with a POST request from a web service, which doesn't seem safer at all.
I could search for free smtp server without the need of credentials, but I want something I can rely on instead of waking up each day and looking if the service still works.
Send the data to a web service.
Okay that would require more work for me, but I would accept that, if there would be a solution without saving the credentials in the app or having a web service which accepts data from everybody.
Have I overlooked something? Or is there no safe method without asking the user for his mail credentials or google account etc. ?
OAuth would probably work. The nice thing about OAuth is that if a token is compromised it can be revoked on the server side.
You could create a web service that accepts TCP connections on some port. You could have some authentication mechanism for example Digest authentication that would be carried out before accepting data.
Another option would be to use an API such as Golgi. Golgi requires a developer key, app key and app instance id to connect to the servers and send data. In the event these credentials somehow get compromised you can simply change the app key and push a new version of the app through the Play Store.
I'd like to write a program, probably a servlet or something to run on the a google app engine that I can send an email to. So not a program to send email, but one that can receieve it and parse it.
My question is, what code or API are out there that can receive an email?
Basically on your google app engine you can use an inbound mail service.
Please see this documentation for more information.
http://code.google.com/appengine/docs/java/mail/overview.html#Receiving_Mail_in_Java
You cant send an email to a program, you send an email to a server, so what you are looking for is a way to access an email server via your program. Unfortunately there is no single solution here, you need to configure your program for every different email account/server you want to access. (If you have ever set up an account in outlook or something like it you will get the idea)
For example here is a link to the gmail api, you could use this to access gmail accounts
http://code.google.com/apis/gmail/
You need to have a mailbox to send message there and you could read messages with the code like this: http://www.java2s.com/Code/Java/Network-Protocol/GetEmailMessageExample.htm
This can be done with a built in Java library.
javax.mail
Check out this link. It should be able to help you get started.
This won't work for every mail server, but depending on your setup it might help.
To send an email to a Java program, that program must be running. Generally that means a server style (aka service) receiver is favored.
For the email to be received, the Java service must understand an email protocol. There are a number of protocols, but SMTP is the standard for receiving email. Once you have a service that understands SMTP protocol for receiving email, you have written a mail server.
Note that most people don't care to write a mail server, as a mail client needs to connect to the server and pull the email to make it readable. Keep this in mind when designing the solution to your problem.
I’ve built an app for a client that basically sends a standard pre written SMS to the client of my client’s phone asking for them to get in contact. Now the client would like to be able to send a pre recorded voice message to an answering service with the touch of a button, can this be done, firstly from an Android phone.
I’m guessing it can be done because when I search for an answer all I can find are apps that someone else has written that do just that.
Sometimes development tutorials can be hard to find when it comes to apps as you just get a long list of people trying to sell their apps…lol.
Does anyone know of such a tutorial?r
This is not an answer but maybe could help
I once wrote an application like that for a particular answering service for a particular provider in my country. To leave a message on their device I was basically required to compose an e-mail with a message recorded as an mp3 file and included as an attachment to the mail. I then send such mail to a specific mail address of their answering service. I had to supply credentials for the mail to be accepted. Such credentials (login/password) I obtained first by sending a specific port SMS to their service.
For composing mails with attachment I used an opensource IMAP client for Android (as a jar library added to my project). Don't rememeber which client it was but can find out.
I guess there's no common standard for that but basically all the answering services should do something similar.
Sorry if this info is too vague, I was just given the protocol of how that particular answering service was working and implemented accordingly.
I've done quite a bit of research on this matter and I can't seem to come up with a solid solution to my problem.
I am developing a Java client application that (should) allow users to import their contacts from Mac Address Book by fetching them in a list format and allowing the user to select a subset/all and click a button that would send an "invitation" to these users.
I was able to grab contacts using the Rococoa Java framework but I am uncertain as to how to send email or if it is even possible. I realize there are security concerns with this, but I was able to accomplish this same task on Outlook for PC.
It seems that I may have to call an Applescript from my Java that manually opens Mac Mail Client and sends email using their default mail account setup.
I could be totally off-base here... should I even bother sending mail through the user's default Mail account? I wanted to avoid using a different mail server to avoid spam etc.
Any help would be appreciated, thank you for your time.
Matt
Here's an applescript to use Mail...
set emailSender to "sender#email.com>"
set emailTo to "recipient#email.com"
set theSubject to "The subject of the mail"
set theContent to "message body"
tell application "Mail"
set newMessage to make new outgoing message with properties {sender:emailSender, subject:theSubject, content:theContent, visible:true}
tell newMessage
make new to recipient at end of to recipients with properties {address:emailTo}
send
end tell
end tell
Another option, if you know the smtp information, is to use python. I made a command line program you can use. Find it here. There's example code to use it on the web page.