2011-06-04 59 views
11

我正在Android上发送电子邮件发送应用程序。通过点击按钮启动我的应用程序时,“仅”字段可见。将电子邮件,密件抄送和主题字段添加到发送Android应用程序的电子邮件中

为什么不显示抄送,密件抄送和主题字段?如何将这些字段添加到我的应用程序?以及如何在收件人字段中显示默认电子邮件地址? (现在什么都不写在要默认域)。

super.onCreate(savedInstanceState); 
setContentView(R.layout.main); 
clickBtn = (Button) findViewById(R.id.sendemail); 
clickBtn.setText("Send email"); 
clickBtn.setOnClickListener(new OnClickListener() { 
    @Override 
    public void onClick(View v) { 
     Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
     String aEmailList[] = { "[email protected]","[email protected]" }; 
     String aEmailCCList[] = { "[email protected]","[email protected]"}; 
     String aEmailBCCList[] = { "[email protected]" }; 
     emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList); 
     emailIntent.putExtra(android.content.Intent.EXTRA_CC, aEmailCCList); 
     emailIntent.putExtra(android.content.Intent.EXTRA_BCC, aEmailBCCList); 
     emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My subject"); 
     emailIntent.setType("text/plain"); 
     emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My message body."); 
     startActivity(emailIntent); 
     //startActivity(Intent.createChooser(emailIntent, "Send mail...")); 
     finish(); 
    } 
}); 
+0

你想添加BCC&CC手动(在动态)或由编码...? – 2011-06-04 05:50:49

+0

@capdroid通过编码.. – 2011-06-04 07:05:31

+0

所以,抄送和密件抄送不是布局? – 2011-06-04 07:08:00

回答

相关问题