android 自动发电子邮件,通过单击android按钮直接发送电子邮件

我正在制作一个应用程序,在该应用程序中,我必须取回编辑文本中的反馈并将该提要发送回硬代码电子邮件地址.用户只需输入他的反馈并按按钮,然后电子邮件就会发送到id. ..现在写在我的应用中,而不是自动发送电子邮件,用户指向电子邮件页面..

请帮助我:)

public void onClick(View arg0) {

// TODO Auto-generated method stub

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

String[] recipients = new String[]{"email@example.com", "",};

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);

emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");

emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");

emailIntent.setType("text/plain");

startActivity(Intent.createChooser(emailIntent, "Send mail..."));

finish();

}

});

解决方法:

首先使用Mail.jar,activation.jar,Additional.jar文件在您的项目中上传

使用此邮件类..遵循此问题有提供答案如何在无意的情况下发送邮件

请享用!

标签:android

来源: https://codeday.me/bug/20191208/2087788.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值