2011-04-07 4 views
0

나는 안드로이드 플랫폼을 연구 중이다. 안드로이드 플랫폼에서 이메일 주소로 데이터를 보내고 싶습니다. 데이터를 보낼 시설을 제공 할 수있는 수업이 있습니까? 안드로이드에있는 이메일 주소로 데이터를 보내는 프로세스가 있다면 ??? 당신이 누군가에 HTML 이메일을 보낼 방법android에서 메일 보내기

답변

3

이 있습니다 :

Intent intent = new Intent(Intent.ACTION_SEND); 
intent.setType("plain/html"); 
intent.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]", "[email protected]"}); 
intent.putExtra(Intent.EXTRA_SUBJECT, "subject"); 
intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("my html text goes here")); 
startActivity(intent); 

pngDirectory이 이미지 '의 위치를 ​​가리키는 File 인 PNG 첨부 파일과 함께 이메일을 보내, 그리고 pngFileName은의 파일 이름입니다 파일 (myFile.png) :

String pngLocation = "file://" + pngDirectory.getPath() + "/" + pngFileName; 
startActivity(new Intent(Intent.ACTION_SEND) 
      .setType("image/png") 
      .putExtra(Intent.EXTRA_SUBJECT, "subject") 
      .putExtra(Intent.EXTRA_STREAM, Uri.parse(pngLocation)) 
      .putExtra(Intent.EXTRA_TEXT, "blah") 
     ); 
+0

더 많은 내용을 편집해야합니까? –