How to send an Email using our own own API? - android

I am using this code to send a mail.
final Intent mail_Intent=new Intent(Intent.ACTION_SEND);
mail_Intent.setType("plain/text");
mail_Intent.putExtra(Intent.EXTRA_EMAIL,new String[]{toText.getText().toString()}); mail_Intent.putExtra(Intent.EXTRA_SUBJECT,subjectText.getText().toString()); mail_Intent.putExtra(Intent.EXTRA_TEXT,bodyText.getText().toString());
Intent i=Intent.createChooser(mail_Intent, "Send Mail");
startActivity(i);
But on the following screen i get the default android API.I do not want that screen to popup. Is there any other way where i can silently send the mail.
Any help is appreciated. Thanks in advance..

If you have access to a server, with a mail server set up on it AND php. Here is a way :
Design whatever layout you like to make the user enter his name, his mail, the recipient, the subject and the mail body (and any other information you might want him to give). Then you grab all this, and put it in a http request adding these parameters in POST and send then to a php page that will deal with sending the email. However, this is a low security method and not really safe in my point of view... So be on your guard...

Related

Send automatic message via android app

I'm just wondering is it possible to send a Message from the app without using actionView or actionSend ( meaning no asking for chooser to send via google or hotmail etc.. ) from the Intent ?
what I want to make is like a TextView and a Button
the user will enter a text in the textview and then click the Button to send the message, then the message will be automiatlly sent to the developer ( me )
I hope what I'm thinking of is possible.
I'm not sure what kind of message you are trying to send, but you can use the SMS feature of the phone to send not only a SMS, but an email, too.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1"+yourPhoneNumber, userPhoneNumber, message, null, null);
You can replace phone numbers with emails and it will work without user interaction (unlike sending an email through an email client which cannot be done automatically). You can try it out by texting your own email. For your specific situation, you could set up a developer email that handles all of these messages that you are trying to send. The only issue with this is that you may not know who you are receiving messages from. For example, if you send a SMS -> email, it might show up as from something#vz.com or something. However, you can mitigate this by including addition info in the message payload itself.
Yes, it is possible. You can use the internet connection to have the message saved to some cloud storage or something. Personally, I prefer using Parse.com because they have an amazing API that saves you a lot of hassle.
Just add the message from the EditText to a ParseObject and call the saveEventually() method. As soon as the internet is back on, the message will be sent to your cloud storage.

Providing feedback with mail in android

I want to put feedback option in android app as some apps do. I presently have this code
Intent Email = new Intent(Intent.ACTION_SEND);
Email.setType("text/email");
Email.putExtra(Intent.EXTRA_EMAIL, new String[] { "feedback#gmail.com" });
Email.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
Email.putExtra(Intent.EXTRA_TEXT, "Hi");
startActivity(Intent.createChooser(Email, "Sending Feedback:"));
But this code redirects to default app. As I don't want to show to address, I came to know that it is not possible with default in-built email app.
Later thought to implement using java api, so that I can hardcode my mail credentials(including username, password) and send it to the mail that I specify. So that user doesn't need to log in. Just he mentions his mail address in the given column, message. That's it. Then after clicking on send button, it should go the feedback mail id. But this is risky if some one converts my apk into source code as they would come to know my credentials that I used for this feedback. Can some one please suggest me how to implement this in a correct way so that user need not have any credentials or mail app?
Sending mail from php:
<?php
$to = "recipient#example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Email successfully sent!</p>");
} else {
echo("<p>Email delivery failed…</p>");
}
?>
An alternative way of hiding you data will be to post it to a server, i.e you may try considering posting your feedback data to some php script or a servlet, which later on forwards it to your mailbox.
There are so many free hostings out there, one I use for same purpose is www.3owl.com, I just have a PHP file there, and all the responses and feedbacks from all the websites are submitted there, which are then forwarded to my mailing address.
And, about mails going to Spam, well mailbox are intelligent these days, they can be taught what is not a spam, and what is :)
You could consider adding a separate API altogether and use their online client to view and manage the messages you receive:
Apptentive
LetThemVote
Recon Instruments

Recive email java

i am using the default email app that come with ics, and i want to catch the email recieving programatically (i want to recieve and sender information and the email body itself), how can i do it? i tried search however i only find how to send email and how to recieve email in gmail (which is not my case)
thanks
Unfortunately, there is no way to "catch" emails as they come to the phone. You'll have to manually connect to the mail server and download the emails. If you're interested in doing that, I've used the javamail-android port, which actually is pretty fully featured.

Android send an email in the background

I have seen many times the ease of sending an email in the foreground using the Android Intent Action.SEND.
However I need to implement a feedback form which emails us the details on completion. This doesnt really suit the Android Intent because the user wouldnt want to see the generated email before sending.
Does anyone have any sample code which can send an email form the background if we assume the smtp server is lol.does.thiswork and the username = lala, password = po.
Cheers
Possible duplicate of this: Sending Email in Android using JavaMail API without using the default/built-in app and plenty of example code in there.
as an editorial note, anytime an application I am using on a phone sends an email, I personally WOULD want it in the foreground. If its just feedback from a form on your application, you could also use several solutions other than email: a web form in a webview, or create a socket back to a server you host, or a use a webservice etc...

How to get content of email like as Email ID ,Subject ,Message body text,and Attachment in android?

I am new to android. I configured the email address in the android emulator.I want to get the email content,if the configured email receives the mail from other mailid.which notification shall i use and how to get the email content when the notification raises the alert. how can i achieve this.
Thanks in advance.....
It sounds to me like you're trying to say that you signed-in to the mail app on the Android device. From my understanding of the question you've raise, signing-in to an email account on the Android device doesn't mean any application can just grab emails from it. The closest solution I can think of is creating an IMAP connection to a mail server to grab mail content.

Categories

Resources