email - Java Mail API send mail with another mail attached -


I want to ask how can I attach an attachment to another mail with the Java Mail API.

  MimeBodyPart Attachment = New MimeBodyPart (); AttachmentPart.setContent (mail, "text /?");   

Thank you in advance!

  javax.mail .Multipart multipart = new MimeMultipart (); Javax.mail.internet.MimeBodyPart MessageBodyPart = new javax.mail.internet.MimeBodyPart (); Multipart.addBodyPart (messageBodyPart); Javax.activation.DataSource Source = New FileDataSource ("C: \\ Notes \\ new mail.msg"); MessageBodyPart.setDataHandler (new DataHandler (source)); MessageBodyPart.setFileName ("new mail.msg"); Multipart.addBodyPart (messageBodyPart); Msg.setContent (Multipurpose); MimeBodyPart part = new MimeBodyPart (); Part.setText (text); Multipart.addBodyPart (part);    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -