【发布时间】:2014-02-14 07:15:31
【问题描述】:
我想将数据发送到电子邮件地址,当我填写表格时,该数据应该被转发到邮件中,因此无需在电子邮件中添加任何消息,点击提交按钮,它应该发送给收件人,
这是我的代码,
btnfeedbacksubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
/*
Validation class will check the error and display the error on respective fields
but it won't resist the form submission, so we need to check again before submit
*/
if ( checkValidation () )
submitForm();
else
Toast.makeText(Feedback.this, "Form contains error", Toast.LENGTH_LONG).show();
Intent Email = new Intent(Intent.ACTION_SEND);
Email.setType("text/email");
Email.putExtra(Intent.EXTRA_EMAIL, new String[] { "abc@def.com" });
Email.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
Email.putExtra(Intent.EXTRA_TEXT, "");
startActivity(Intent.createChooser(Email, "Sending Feedback:"));
}
});
}
这是我的表单图片
我想通过邮件发送此详细信息。
请帮我解决这个问题, 谢谢。
【问题讨论】: