@@ -0,0 +1,2088 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.glaf.test.mail;%0A%0Aimport java.util.Collection;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0A%0Aimport org.junit.Test;%0A%0Aimport com.glaf.core.config.SystemProperties;%0Aimport com.glaf.core.context.ContextFactory;%0Aimport com.glaf.mail.MailMessage;%0Aimport com.glaf.mail.MailSender;%0A%0Apublic class SendMailTest %7B%0A%0A%09@Test%0A%09public void sendMail() throws Exception %7B%0A%09%09System.out.println(%22ConfigRootPath:%22+SystemProperties.getConfigRootPath());%0A%09%09Map%3CString, Object%3E dataMap = new java.util.HashMap%3CString, Object%3E();%0A%09%09dataMap.put(%22taskDescription%22, %22%E9%82%AE%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91%22);%0A%09%09dataMap.put(%22processStarterName%22, %22%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%91%98%22);%0A%09%09dataMap.put(%22serviceUrl%22, %22http://127.0.0.1:8080/glaf%22);%0A%09%09dataMap.put(%22callback%22, %22http://127.0.0.1:8080/glaf/task.jsp%22);%0A%0A%09%09MailMessage mailMessage = new MailMessage();%0A%09%09mailMessage.setFrom(%22joy@127.0.0.1%22);%0A%09%09mailMessage.setTo(%22joy@127.0.0.1%22);%0A%09%09mailMessage.setSubject(%22%E6%B5%8B%E8%AF%95%E9%82%AE%E4%BB%B6%E6%A8%A1%E6%9D%BF%22);%0A%09%09mailMessage.setDataMap(dataMap);%0A%09%09//mailMessage.setContent(%22%E6%B5%8B%E8%AF%95%E6%B5%8B%E8%AF%95%22);%0A%09%09mailMessage.setTemplateId(%22sendToSupplier%22);%0A%09%09mailMessage.setSupportExpression(false);%0A%0A%09%09Collection%3CObject%3E files = new HashSet%3CObject%3E();%0A%0A%09%09mailMessage.setFiles(files);%0A%09%09mailMessage.setSaveMessage(false);%0A%09%09MailSender mailSender = ContextFactory.getBean(%22mailSender%22);%0A%09%09mailSender.send(mailMessage);%0A%09%7D%0A%0A%7D%0A

add send mail test