如何用户在挂号邮件上发送重定向邮件?

时间:2017-04-19 06:38:55

标签: android

我在POST请求后从json获得以下链接:

http://kartpay.net/inde.php?dispatch=auth.ekey_login&ekey=9d19e143037830a8d2d17f564997f394&company_id=0&redirect_url=http%3A%2F%2Fkartpay.net%2Fbigbuys-latest%2Findex.php

我想在用户点击登录按钮时通过电子邮件发送此链接?

1 个答案:

答案 0 :(得分:0)

您可以使用电子邮件意图发送链接。

  Button login;
String emaillink = "http://kartpay.net/inde.php?dispatch=auth.ekey_login&ekey=9d19e143037830a8d2d17f564997f394&company_id=0&redirect_url=http%3A%2F%2Fkartpay.net%2Fbigbuys-latest%2Findex.php\"";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_checking_intent);
    login = (Button) findViewById(R.id.button);
    login.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            Intent i = new Intent(Intent.ACTION_SEND);
            i.setType("message/rfc822");
            i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@example.com"});
            i.putExtra(Intent.EXTRA_SUBJECT, "subject of your email");
            i.putExtra(Intent.EXTRA_TEXT   , emaillink);
            try {
                startActivity(Intent.createChooser(i, "Send mail..."));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(CheckingIntent.this, "There are no email app installed.", Toast.LENGTH_SHORT).show();
            }
        }
    });
}