2009-09-17 4 views
0

jsp에서 메일 링을위한 "one-liner"를 찾고 있습니다. 웹 마스터 메일 주소에 5 개의 매개 변수 값만 보내고 싶습니다. 간단한 해결책에 대한 아이디어가 있습니까?jsp 메일의 짧은 버전?

답변

1
6 라이너와 같은

더 많은,하지만 당신은 사용할 수 있습니다 commons-email :

import org.apache.commons.mail.SimpleEmail; 
... 

    SimpleEmail email = new SimpleEmail(); 
    email.setHostName("mail.myserver.com"); 
    email.addTo("[email protected]", "John Doe"); 
    email.setFrom("[email protected]", "Me"); 
    email.setSubject("Test message"); 
    email.setMsg("This is a simple test of commons-email"); 
    email.send(); 
+0

감사합니다! 충분하다.) – shevron