title: Send mail function in java doesnt send .zip as the attachment
body: <p>This send mail function is working for all types of files like .html,.txt as attachment. But when i try to send a .zip folder as attachment , it terminates. </p>
  
  <pre><code>public void sendmail(){
         System.out.println("started function");
          String from = "amritharajeevan.77@gmail.com";
              // Sender's email ID needs to be mentioned
              String to = "amritha2.rajeevan@aricent.com";
  
              final String username = "amritharajeevan.77";//change accordingly
              final String password = "vivekrajeevan";//change accordingly
  
              // Assuming you are sending email through gmail.com
              String host = "smtp.gmail.com";
  
              Properties props = new Properties();
              props.put("mail.smtp.auth", "true");
              props.put("mail.smtp.starttls.enable", "true");
              props.put("mail.smtp.host", host);
              props.put("mail.smtp.port", "25");
              Session session = Session.getInstance(props,
                 new javax.mail.Authenticator() {
                    protected javax.mail.PasswordAuthentication getPasswordAuthentication() {
                       return new javax.mail.PasswordAuthentication(username, password);
                    }
                 });
  
              try {
                 Message message = new MimeMessage(session);
                 message.setFrom(new InternetAddress(from));
                 message.setRecipients(Message.RecipientType.TO,
                    InternetAddress.parse(to));
                 message.setSubject("Server Error");
                 BodyPart messageBodyPart = new MimeBodyPart();
                 messageBodyPart.setText("Server"+" " +servererror+ " " +" is unreachable. Please check the logs.");
                 Multipart multipart = new MimeMultipart();
                 multipart.addBodyPart(messageBodyPart);
                 messageBodyPart = new MimeBodyPart();
                 String filename = "/Users/aricent/Desktop/amritha/seetest/May6.zip";
                 DataSource source = new FileDataSource(filename);
                 messageBodyPart.setDataHandler(new DataHandler(source));
                 messageBodyPart.setFileName(filename);
                 multipart.addBodyPart(messageBodyPart);
                 message.setContent(multipart);
                 System.out.println("sent start function");
                 Transport.send(message);
  
                 System.out.println("Sent message successfully....");
  
              } catch (MessagingException e) {
                 throw new RuntimeException(e);
              }
           }
  </code></pre>
  
  <p>So i dont know what to do? please tell me what part of my code should i change. I tried for .txt and .html files. It works fine.</p>