導航:首頁 > 操作系統 > android調用郵箱

android調用郵箱

發布時間:2023-01-31 20:03:14

㈠ Android開發中怎樣調用系統Email發送郵件

在Android中,調用Email有三種類型的Intent:
Intent.ACTION_SENDTO 無附件的發送
Intent.ACTION_SEND 帶附件的發送
Intent.ACTION_SEND_MULTIPLE 帶有多附件的發送

【方法1】使用SENTTO發送

java">Intentdata=newIntent(Intent.ACTION_SENDTO);
data.setData(Uri.parse("mailto:[email protected]"));
data.putExtra(Intent.EXTRA_SUBJECT,"這是標題");
data.putExtra(Intent.EXTRA_TEXT,"這是內容");
startActivity(data);
Intentdata=newIntent(Intent.ACTION_SENDTO);
data.setData(Uri.parse("mailto:[email protected]"));
data.putExtra(Intent.EXTRA_SUBJECT,"這是標題");
data.putExtra(Intent.EXTRA_TEXT,"這是內容");
startActivity(data);

【方法2】使用SEND發送

Intentintent=newIntent(Intent.ACTION_SEND);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
String[]bccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_BCC,bccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");
intent.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///mnt/sdcard/a.jpg"));
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);
Intentintent=newIntent(Intent.ACTION_SEND);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
String[]bccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_BCC,bccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");
intent.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///mnt/sdcard/a.jpg"));
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);

很簡單,發送郵件中,有收件者,抄送者,密送者。 也就是分別通過
Intent.EXTRA_EMAIL,
Intent.EXTRA_CC,
Intent.EXTRA_BCC
來進行putExtra來設定的,而單個附件的發送,則使用Intent.EXTRA_STREAM來設置附件的地址Uri。

【方法3】使用SEND_MULTIPLE來進行多附件的發送

Intentintent=newIntent(Intent.ACTION_SEND_MULTIPLE);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");
ArrayList<uri>imageUris=newArrayList<uri>();
imageUris.add(Uri.parse("file:///mnt/sdcard/a.jpg"));
imageUris.add(Uri.parse("file:///mnt/sdcard/b.jpg"));
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,imageUris);
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);
Intentintent=newIntent(Intent.ACTION_SEND_MULTIPLE);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");
ArrayList<uri>imageUris=newArrayList<uri>();
imageUris.add(Uri.parse("file:///mnt/sdcard/a.jpg"));
imageUris.add(Uri.parse("file:///mnt/sdcard/b.jpg"));
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,imageUris);
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);

㈡ 安卓手機如何添加電子郵件賬戶

您好,以三星手機為例,三星手機電子郵件設置操作方法:首先開啟移動數據或WLAN無線網路,然後進入應用程序-電子郵件-手機中會預置部分郵箱,如163郵箱等。
1.若使用的是預置的電子郵箱,以163郵箱為例。操作:
應用程序-電子郵件-點擊「163」-輸入郵箱地址和密碼-點擊「下一步」-自動匹配郵箱信息,按照提示逐步點擊配置直到完成。
2.若使用的是非預置的電子郵箱,請操作:
1).應用程序-電子郵件-其它-輸入郵箱地址和密碼-點擊「手動設置」。
2).系統將提示選擇賬戶類型:「微軟Exchange賬戶」、「POP3賬戶」、「IMAP賬戶」,根據郵箱賬戶協議正確選擇。
3).填寫接收伺服器和發送伺服器相關參數(具體參數需聯系郵箱客服人員)。
4).為賬戶設置名稱,然後點擊完成即可。
完成以上步驟後,郵箱就設置成功了,郵件將自動接收至收件箱中。

㈢ 如何在安卓Android手機上使用outlook軟體發企業Exchange郵件

㈣ Android開發中怎樣調用系統Email發送郵件

您好,很高興為您解答。


Android調用Email有三種類型的Intent:
Intent.ACTION_SENDTO 無附件的發送
Intent.ACTION_SEND 帶附件的發送
Intent.ACTION_SEND_MULTIPLE 帶有多附件的發送


調用Email是Email可以接收Intent並做這些事情,可能也有其他的應用程序實現相關功能,所以在執行的時候,會出現選擇框進行選擇。


1、使用SENTTO發送使用SENTTO發送

Intentdata=newIntent(Intent.ACTION_SENDTO);
data.setData(Uri.parse("mailto:[email protected]"));
data.putExtra(Intent.EXTRA_SUBJECT,"這是標題");
data.putExtra(Intent.EXTRA_TEXT,"這是內容");
startActivity(data);

Intentdata=newIntent(Intent.ACTION_SENDTO);
data.setData(Uri.parse("mailto:[email protected]"));
data.putExtra(Intent.EXTRA_SUBJECT,"這是標題");
data.putExtra(Intent.EXTRA_TEXT,"這是內容");
startActivity(data);


通過向Intent中putExtra來設定郵件的相關參數。

2、使用SEND發送

Intentintent=newIntent(Intent.ACTION_SEND);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
String[]bccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_BCC,bccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");

intent.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///mnt/sdcard/a.jpg"));
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);

Intentintent=newIntent(Intent.ACTION_SEND);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
String[]bccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_BCC,bccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");

intent.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///mnt/sdcard/a.jpg"));
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);


分別通過Intent.EXTRA_EMAIL,
Intent.EXTRA_CC,
Intent.EXTRA_BCC
進行putExtra來設定。單個附件的發送,使用Intent.EXTRA_STREAM來設置附件的地址Uri。

3、使用SEND_MULTIPLE來進行多附件的發送

Intentintent=newIntent(Intent.ACTION_SEND_MULTIPLE);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");

ArrayList<uri>imageUris=newArrayList<uri>();
imageUris.add(Uri.parse("file:///mnt/sdcard/a.jpg"));
imageUris.add(Uri.parse("file:///mnt/sdcard/b.jpg"));
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,imageUris);
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);

Intentintent=newIntent(Intent.ACTION_SEND_MULTIPLE);
String[]tos={"[email protected]"};
String[]ccs={"[email protected]"};
intent.putExtra(Intent.EXTRA_EMAIL,tos);
intent.putExtra(Intent.EXTRA_CC,ccs);
intent.putExtra(Intent.EXTRA_TEXT,"body");
intent.putExtra(Intent.EXTRA_SUBJECT,"subject");

ArrayList<uri>imageUris=newArrayList<uri>();
imageUris.add(Uri.parse("file:///mnt/sdcard/a.jpg"));
imageUris.add(Uri.parse("file:///mnt/sdcard/b.jpg"));
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,imageUris);
intent.setType("image/*");
intent.setType("message/rfc882");
Intent.createChooser(intent,"ChooseEmailClient");
startActivity(intent);

發送多個附件,通過putParcelableArrayListExtra將多個附件的Uri地址List設置進去


如若滿意,請點擊右側【採納答案】,如若還有問題,請點擊【追問】


希望我的回答對您有所幫助,望採納!


~O(∩_∩)O~

閱讀全文

與android調用郵箱相關的資料

熱點內容
車輛超過2年未解壓 瀏覽:459
mobitopdf在線 瀏覽:73
微指令控制欄位的編譯方法有 瀏覽:392
cad印刷命令怎麼用 瀏覽:688
冷庫壓縮機轉速不穩定 瀏覽:970
8pe513編程 瀏覽:325
互聯網關閉根伺服器是什麼樣 瀏覽:929
1g的文件夾可以壓縮後發送么 瀏覽:761
php遠程請求 瀏覽:114
小說程序員哪有那麼可愛 瀏覽:183
將軍與命令游戲劇情 瀏覽:39
心理pdf 瀏覽:201
類似螃蟹通告的小程序源碼開發 瀏覽:227
單片機怎麼寫課設報告 瀏覽:324
壓縮文件損壞的md5會變嗎 瀏覽:550
選擇雲伺服器申請注冊 瀏覽:820
php前端模版 瀏覽:981
粵康碼app怎麼弄 瀏覽:367
次梁與剪力牆相交箍筋加密怎麼算 瀏覽:909
phpword轉換pdf 瀏覽:334