public void testAttachmentHTML(){
  EMail emailTest=new EMail(System.getProperties(),host,from,to,null,null);
  emailTest.addTo(to2);
  emailTest.addCc(to3);
  emailTest.setMessageHTML("TestAttachmentHTML","Test Attachment HTML Message");
  emailTest.addAttachment(new File("C:\\Adempiere\\RUN_Adempiere.sh"));
  emailTest.createAuthenticator(usr,pwd);
  assertEquals(emailTest.send(),EMail.SENT_OK);
}

public void testAttachmentHTML ( ) { EMail emailTest = new EMail ( System . getProperties ( ) , host , from , to , null , null ) ; emailTest . addTo ( to2 ) ; emailTest . addCc ( to3 ) ; emailTest . setMessageHTML ( "TestAttachmentHTML" , "Test Attachment HTML Message" ) ; emailTest . addAttachment ( new File ( "C:\\Adempiere\\RUN_Adempiere.sh" ) ) ; emailTest . createAuthenticator ( usr , pwd ) ; assertEquals ( emailTest . send ( ) , EMail . SENT_OK ) ; }
test sending to internal public void testinternal ( ) { email emailtest = new email ( host , from , from , " testinternal " , " test internal message " ) ; assertequals ( emailtest . send ( ) , email . sent_ok ) ; } / / testinternal / test sending to internal authenticated public void testinternalauthenticate ( ) { email emailtest = new email ( host , from , from , " testinternalauthenticate " , " test internal authenticate message " ) ; emailtest . setemailuser ( usr , pwd ) ; assertequals ( emailtest . send ( ) , email . sent_ok ) ; } / / testinternalauthenticate / test sending to external public void testexternal ( ) { email emailtest = new email ( host , from , to , " testexternal " , " test external message " ) ; assertnotsame ( emailtest . send ( ) , email . sent_ok ) ; } / / testexternal / test sending to external authenticated public void testexternalauthenticate ( ) { email emailtest = new email ( host , from , to , " testexternalauthenticate " , " test external authenticate message " ) ; emailtest . setemailuser ( usr , pwd ) ; assertequals ( emailtest . send ( ) , email . sent_ok ) ; } / / testexternalauthenticate / test sending html public void testhtml ( ) { email emailtest = new email ( host , from , to ) ; emailtest . addcc ( to2 ) ; emailtest . setmessagehtml ( " testhtml " , " test html message " ) ; emailtest . setemailuser ( usr , pwd ) ; assertequals ( emailtest . send ( ) , email . sent_ok ) ; } / / testhtml / test sending attachment public void testattachment ( ) { email emailtest = new email ( host , from , to , " testattachment " , " test attachment message " ) ; emailtest . addto ( to2 ) ; emailtest . addcc ( to3 ) ; emailtest . addattachment ( new file ( " c : \ \ adempiere \ \ run_adempiere . sh " ) ) ; emailtest . setemailuser ( usr , pwd ) ; assertequals ( emailtest . send ( ) , email . sent_ok ) ; } / / testattachmenthtml / test sending attachment html
