 <p>Try this:</p> <pre><code> String filename = "example_filename"; Multipart _multipart = new MimeMultipart(); BodyPart messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(filename); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); _multipart.addBodyPart(messageBodyPart); message.setContent(_multipart); </code></pre> <p><strong>EDIT:</strong></p> <p>When you include <code>aFileChooser</code> library, you should create two buttons in your layout of the activity ("Send an email" and "Choose a file"), then in your activity:</p> <pre><code>private Button sendEmail; private Button chooseFileButton; private String filename; private static final int REQUEST_CHOOSER = 1234; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); sendEmail = (Button) findViewById(R.id.send_email_button_id); sendEmail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new Thread(new Runnable() { @Override public void run() { try { Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected javax.mail.PasswordAuthentication getPasswordAuthentication() { return new javax.mail.PasswordAuthentication( username, password); } }); // TODO Auto-generated method stub Message message = new MimeMessage(session); message.setFrom(new InternetAddress("from-email@gmail.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("youremail@gmail.com")); message.setSubject("email"); message.setText("HI," + "\n\n great"); if (!"".equals(filename)) { Multipart _multipart = new MimeMultipart(); BodyPart messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(filename); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); _multipart.addBodyPart(messageBodyPart); message.setContent(_multipart); } Transport.send(message); System.out.println("Done"); } catch (MessagingException e) { throw new RuntimeException(e); } } }).start(); } }); chooseFileButton = (Button) findViewById(R.id.choose_file_button_id); chooseFileButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Create the ACTION_GET_CONTENT Intent Intent getContentIntent = FileUtils.createGetContentIntent(); Intent intent = Intent.createChooser(getContentIntent, "Select a file"); startActivityForResult(intent, REQUEST_CHOOSER); } }); } </code></pre> <p>After that add <code>onActivityResult</code> method, where you can get selected filename:</p> <pre><code>@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CHOOSER: if (resultCode == RESULT_OK) { final Uri uri = data.getData(); // Get the File path from the Uri filename = FileUtils.getPath(this, uri); } break; } } </code></pre> <p>Don't forget to add FileChooserActivity to your <code>AndroidManifest.xml</code>:</p> <pre><code>&lt;activity android:name="com.ipaulpro.afilechooser.FileChooserActivity" android:icon="@drawable/ic_launcher" android:enabled="true" android:exported="true" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.GET_CONTENT" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;category android:name="android.intent.category.OPENABLE" /&gt; &lt;data android:mimeType="*/*" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>After that you can send an email, by click on the "Send" button;</p>