Reputation: 10079
I need to send a message to client email address.Client mail id was
[email protected]
.
I never need to give a client email address in output.I need to give that client email address as static.
ContactFragment.java:
view.findViewById(R.id.textView10).setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View v) {
String name=edit1.getText().toString();
String e_mail = edit2.getText().toString();
String subject = edit3.getText().toString();
String message = edit4.getText().toString();
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_EMAIL, e_mail);
i.putExtra(Intent.EXTRA_TEXT, name);
i.putExtra(Intent.EXTRA_SUBJECT, subject);
i.putExtra(Intent.EXTRA_TEXT, message);
//i.setType("message/rfc822");
i.setData(Uri.parse("mailto:"+"[email protected]")); -->Client Email address for an example
//startActivity(Intent.createChooser(i, "Choose an Email client :"));
}
});
So far I done a code like these.Finally the message was send successfully.
But I check that email address.The message wasn't received.Anybody can help me with these.Thank you.
Upvotes: 0
Views: 89
Reputation: 1007544
If you are using mailto:
, you need to use ACTION_SENDTO
, not ACTION_SEND
.
Beyond that, the user must send the email -- all ACTION_SEND
and ACTION_SENDTO
will do is set up the message in the user's email app's "composer".
Upvotes: 1