seam 메일 보내기 이메일 예시

1754 단어 jbossXHTMLJSFsunseam
다음은 csdn의 대답으로 옮겨서 사용할 때 참고하여 찾을 수 없도록 합니다
1. 메일 지원 설정(components.xml)
<mail:mail-session debug="true" host="xx.stmp.com" password="passwd" port="25" username="user" /> 

 2.템플릿 작성(resetStaffPwdMail.xhtml)
<m:message charset="UTF-8"
    xmlns="http://www.w3.org/1999/xhtml" 
xmlns:ui="http://java.sun.com/jsf/facelets" 
xmlns:s="http://jboss.com/products/seam/taglib" 
xmlns:m="http://jboss.com/products/seam/mail" 
xmlns:h="http://java.sun.com/jsf/html" 
xmlns:f="http://java.sun.com/jsf/core"> 

<m:from name=" " address="[email protected]" /> 
<m:to name="#{staffPasswordMgr.staffName}">#{staffPasswordMgr.staffEmail} </m:to> 
<m:subject> ! </m:subject> 
<m:body> 
    <p> <h:outputText value=" [#{staffPasswordMgr.staffName}" />]: </p> 
    <p> [ <h:outputText value="#{staff.loginName}" />] ! </p> 
    <p> : <h:outputText value="#{staffPasswordMgr.staffId}" /> </p> 
    <p> : <h:outputText value="#{staffPasswordMgr.staffPwd}" /> </p> 
    <p> , , , ! </p> 
</m:body> 
</m:message> 

 
3.action
public void sendMail() throws Exception { 
try { 
    renderer.render("/admin/staff/resetStaffPwdMail.xhtml"); 
    facesMessages.add(" !"); 
} catch (Exception e) { 
    log.error(" :", e.toString()); 
    facesMessages.add(" :" + e.toString()); 
} 
}

 

좋은 웹페이지 즐겨찾기