2011-10-07 5 views
3

이메일로 여러 개의 이미지를 보내는 방법은 무엇입니까? 첨부 할 필요없이 이미지가 이메일 본문에있는 것을 선호합니다.SD 카드의 여러 이미지를 이메일에 첨부하는 방법은 무엇입니까?

이 코드를 실행했지만 작동하지 않습니다.

+1

는 "이 코드"* *인가? 그리고 그 문제는 정확히 무엇입니까? –

+0

다음 페이지에서보십시오 : http://stackoverflow.com/questions/5074619/send-e-mail-in-html-format –

답변

6

경우 매장 이미지 경로 주소의 SD 카드

image_path.add(Environment.getExternalStorageDirectory() + "/defaultg1.jpg"); 
image_path.add(Environment.getExternalStorageDirectory() + "/defaultg2.jpg"); 

if(image_path.size() > 0 && edt_weight1.getText().length() > 0 && edt_weight2.getText().length() > 0){ 
      ArrayList<Uri> uris = new ArrayList<Uri>(); 
      for(int i=0;i<image_path.size();i++){ 

        File fileIn = new File(image_path.get(i)); 
         Uri u = Uri.fromFile(fileIn); 
         uris.add(u); 
       } 

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); 
    emailIntent.setType("image/jpg"); 
    emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Enjoy the photo"); 
    emailIntent.putExtra(Intent.EXTRA_TEXT, "Plz find the attachment."); 
    emailIntent.putExtra(Intent.EXTRA_STREAM, uris); 
    startActivity(Intent.createChooser(emailIntent, "Email:")); 

코드를 즐길 수에 대한 IMAGE_PATH 배열 목록 사용 ...

관련 문제