It is possible to hide the destination email address? - android

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.

Related

android ACTION_SENDTO creates email doesn't send it

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.

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

Simple mail sender

Earlier I was using an intent to complete this operation:
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"xxxxxxx#gmail.com"});
email.putExtra(Intent.EXTRA_TEXT, "");
email.setType("message/rfc822");
try{
startActivity(Intent.createChooser(email, "Feedback to TFC"));
}catch(android.content.ActivityNotFoundException e)
{
Toast.makeText(getApplicationContext(), "There are no email clients installed", Toast.LENGTH_SHORT).show();
}
But then again the intent results in a form with the address, subject and the message. For now I only want the message part. I did have a look at this blog . Is it necessary to give the username and password ?? Is there no simple mailto: function in android as we see in html so that the message is just sent without me having to use the all the complicated functions ?
You can refer to https://stackoverflow.com/a/2033124/1051147 which explains how to Send e-mail in Android using the JavaMail API using Gmail authentication
note that you will need some additional jar for getting it done. As i explained the simplest method is to use intent.

Android Send Email not present in email client sent

When I try to send an email (for example with gmail client) via INTENT, in my email client I don't see the email sent. The code is:
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[] { to });
email.putExtra(Intent.EXTRA_SUBJECT, subject);
email.putExtra(Intent.EXTRA_TEXT, message);
email.setType("application/zip");
email.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(pathZipCryptDestination)));
email.setType("message/rfc822");
activity.startActivity(Intent.createChooser(email, "E-Mail:"));
The email arrives but I don't see it in email sent.
I must set some parameter?
What client are you exactly using?
Basically all you do is pass some data to the other app, which uses this.
It has little to do with your own app, as the other app takes over and completes sending the email. If somehow they do not do this properly and thus your email is not added to your 'send emails' that sounds more like a problem in their app and out of your hands.

Email sending via Android Application

I want to send email from my application without configuration email in android device.
can we do this?? we click a button and mail will automatically to the recipient.
I have used the following code. where we can give the sender name.
and can we send mail via android emulator.
Thanx.
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_EMAIL , new String[]{"abc#example.com"});
intent.putExtra(Intent.EXTRA_SUBJECT, "Request For Quote");
intent.putExtra(Intent.EXTRA_TEXT , "Hi....");
try {
//startActivity(Intent.createChooser(intent, "Send mail..."));
startActivity(intent);
//Toast.makeText(SendingEmailActivity.this, "Mail Sent Successfully", Toast.LENGTH_SHORT).show();
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(DemoActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
Check this thread
Sending Email in Android using JavaMail API without using the default/built-in app
Without any intervention, you couldn't use Intents.
Take a look at This tutorial about javamail and android

Categories

Resources