android ACTION_SENDTO creates email doesn't send it - android

Have working code that 1) opens an email client on an android device and 2) successfully populates all the fields needed to send a message. This includes the to, from, subject and message body.
e String mailMsg = "mailto:elmer#gmail.com" +
"?cc="+"" + //needed to fill out email properly
"&subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(emailBody);
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.setData(Uri.parse(mailMsg));
try{
context.startActivity(emailIntent);
}catch (ActivityNotFoundException ae){
Log.d("TEST100 ","Error sending email");
}
Again the code works fine in terms of opening the email client, creating an populating the email message but, it does not send the email. Could it be because I have multiple email providers? The code always manages to connect to and work with my mai based provider.
Have read the google documentation and most relevant posts in stackoverflow, is it possible to:
1. trigger the sending of the email message without user involvement?
2. mask the display/process of creating the email?
Any information appreciated

is it possible to: trigger the sending of the email message without user involvement?
Fortunately, no.
mask the display/process of creating the email?
Fortunately, no.
Malware authors, spammers, and the like would love to have the ability to send an email, without user involvement, using the user's own email account. Most users would find this behavior to be inappropriate.
If you want to send an email without user involvement, have your Web service send the email on your behalf, using your own email account and your own mail server.

Related

Firebase Dynamic Link DMARC Error Android

I have been using Firebase Dynamic Links in my app for users to send email invites to other users. However, a user reported that using a Yahoo! email blocks her email invites with this error:
550 5.7.1 unauthenticated email from yahoo.com is not accepted due to domain's DMARC policy. Please contact the administrator of yahoo.com domain if this was a legitimate mail. Please visit https://support.google.com/mail/answer/2451690 to learn more about the DMARC initiative.
However when reading about the said DMARC initiative, it needs to set some DKIM keys to the domain of the sender, in which we don't have control since the user is just using Yahoo! This is the code I used to send Firebase Dynamic Links.
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(mInviteMessage.getText())
.setDeepLink(Uri.parse("http://www.crimeresponder.com/invitation?access=" + CRLUser.Roles.getCode(mAccessDropdown.getSelectedItem().toString())
+ "&stationId=" + stationId
+ "&city=" + city))
.setCallToActionText(getString(R.string.invitation_cta))
.build();
startActivityForResult(intent, REQUEST_INVITE);

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

It is possible to hide the destination email address?

In my app I have an option, "Contact us", but anyway, I would like that the user to not see the email address where they send the email. I use the standard way to send the email, but however I build the interface, when the Email Client starts the destination email is shown.
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"myemail#gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
//i.putExtra(Intent.EXTRA_TEXT , "emailBody");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(SecondActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
I would like that myemail#gmail.com to be undisclosed to users.
Over the internet we find this in many cases, where just a button "Send" is provided, for example, but how could we do this on Android?
I would like that myemail#gmail.com to be undisclosed to users.
If you wish to use ACTION_SEND, the user has the right to know the content they are sending and the email address they are sending it to, and to modify any of that as they see fit. It is their device, their email account doing the sending, and their bandwidth that is being consumed.
Over the internet we find this in many cases, where just a button "Send" is provided
The Web server is sending the email, rather than asking the user's browser to send the email.
how could we do this on Android?
You are welcome to find a JavaMail port for Android, or an equivalent library, and send the email directly yourself. Of course, you will need to configure your app to know an SMTP relay that you can use to do the sending.

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.

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