0
                              **My code?**

public static void sendEmail(ExchangeService service, String to ,  String subject, String body) throws Exception {
    EmailMessage email = new EmailMessage(service);         
    email.getToRecipients().add(to);        
    email.setSubject(subject);
    email.setBody(new MessageBody(BodyType.HTML ,body));                        
    FileAttachment attachment =email.getAttachments().addFileAttachment("upload.jpg" , "D:\\EclipseIDE\\eclipse-indigo-new\\workspace\\SCM\\resources\\images\\upload.jpg");            
    attachment.setContentType("image");  

    attachment.setIsInline(true);       
    attachment.setContentId("upload.jpg");      
    email.send();           
}
4

0 回答 0