歡迎大家在這裡學習android發送郵件代碼!下面是我們給大家整理出來的精彩內容。希望大家在這裡學習!
String to = toEmail.getText().toString(); String subject = emailSubject.getText().toString(); String message = emailBody.getText().toString(); Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_EMAIL, new String[] { to }); email.putExtra(Intent.EXTRA_SUBJECT, subject); email.putExtra(Intent.EXTRA_TEXT, message); // need this to prompts email client only email.setType("message/rfc822"); startActivity(Intent.createChooser(email, "Choose an Email client"));
好了,android發送郵件代碼內容就給大家介紹到這裡了。希望大家繼續關注我們的網站!
相關推薦:
android調用浏覽器打開鏈接的方法