各位大侠
请问如何在后台自动发送mail了?
采用下面的方法总是会弹出邮箱界面,还需手动点击发送键才能将邮件发出去。 Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.setType("plain/text");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Hi,all!");
if(setAirPlane)
emailIntent.putExtra(Intent.EXTRA_TEXT, "My Phone has switched to Air Plane Mode");
else
emailIntent.putExtra(Intent.EXTRA_TEXT, "My Phone has cancelled Air Plane Mode");
startActivity(emailIntent);谢谢!
请问如何在后台自动发送mail了?
采用下面的方法总是会弹出邮箱界面,还需手动点击发送键才能将邮件发出去。 Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.setType("plain/text");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Hi,all!");
if(setAirPlane)
emailIntent.putExtra(Intent.EXTRA_TEXT, "My Phone has switched to Air Plane Mode");
else
emailIntent.putExtra(Intent.EXTRA_TEXT, "My Phone has cancelled Air Plane Mode");
startActivity(emailIntent);谢谢!
可以参考系统自带程序email,自己实现一个....