这是我的代码,我需要发送邮件!!一切都工作正常,但我需要默认情况下在" to"字段本身..而不是来自用户?我刚接触到android plz帮助!!
package com.example.newactivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Revert extends Activity {
String anu;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
String message = "Our Valuable Feedback";
Intent emailintent = new Intent(android.content.Intent.ACTION_SEND);
emailintent.putExtra(android.content.Intent.EXTRA_EMAIL,
"xxx@gmail.com");
emailintent.putExtra(android.content.Intent.EXTRA_SUBJECT, "i hate u");
emailintent.setType("plain/text");
emailintent.putExtra(android.content.Intent.EXTRA_SUBJECT, message);
startActivity(emailintent);
}
}
答案 0 :(得分:0)
这是在发送邮件的意图中添加收件人邮件的方法
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"recipient@example.com"});
邮件正文
i.putExtra(Intent.EXTRA_TEXT , "body of email");