일단 Commons-Email.jar과 JavaMail의 mail.jar와 JAF의 activation.jar 이 3가지를 다운 받았습니다.

그런데.. 외부 jar을 추가하는데 엄청난 양의 warning이 나옵니다..

warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

이렇게요...그리곤 실행하면 앱이 강제종료 되죠..

그래서 혹시 몰라 그냥 자바 프로젝트를 만들어서 테스트 해보았습니다.
jar 추가도 잘되고.. 메일도 잘 보내지더군요..-_-;;

도대체 안드로이드에선 왜 안되는 것일까요..
로그를 보니까 클래스들을 못찾더라고요.. 제 생각인데.. jar 추가에서 문제가 있는듯 한데요..

소스와 로그도 올립니다. 도와주세요 ㅠㅠ로그캣에러.png


package com.test;
import org.apache.commons.mail.*;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class EmailTest_with_Attachment_Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button btn = (Button)findViewById(R.id.Button01);
        btn.setOnClickListener(new View.OnClickListener() {
   
   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
    EmailAttachment attchment = new EmailAttachment();
          attchment.setPath("file://"+Environment.getExternalStorageDirectory()+"/ssk.jpg");
          attchment.setDisposition(EmailAttachment.ATTACHMENT);
          attchment.setDescription("Picture of SSK");
          attchment.setName("ssk.jpg");
          
          MultiPartEmail email = new MultiPartEmail();
          email.setCharset("euc-kr"); 
          email.setHostName("메일서버주소");
          email.setAuthentication("계정", "아이디");
          try {
     email.addTo("수신자주소", "이름");
     email.setFrom("발신자주소");
           email.setSubject("Send Picture");
           email.setMsg("Email Test with Attachment.");
           email.attach(attchment);
           email.send();
    } catch (EmailException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }
//    MailSender mySender = new MailSender();
    
   }
  });
  }
}
// 물론 위에 한글로 써진 부분은 다 제대로 채워 넣었습니다.