如何将电子邮件发送到特定的电子邮件? [英] How to send email to specific email?

查看:278
本文介绍了如何将电子邮件发送到特定的电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下条件:

I have following condition:

我如何发送电子邮件至example@mail.com在提交按钮 clicklistener?

How do I send email to example@mail.com on submitButton clicklistener ?

submitButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            //how to send email ??

        }
    });

帮助!

推荐答案

它非常简单。在你的的onClick 方法简单地创建并填充以下意图

Its very simple. In your onClick method simply create and populate the following Intent

Intent i = new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@example.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject");
i.putExtra(Intent.EXTRA_TEXT   , "body");
startActivity(Intent.createChooser(i, "Email:"));

这篇关于如何将电子邮件发送到特定的电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆