jenkins mail function configuration

one. Global configuration requirements

1. Configure Jenkins Location

 

2.配置 Extended-Email Notification

 

User SSL: If the mailbox provided by the service provider is used, check the SSL option (port 465 ) ; if it is a company mailbox, if the encryption protocol is not used, do not check the SSL option (port 25 ) .

3.Default Content— " html displayed by mail

<!DOCTYPE html>    

<html>    

<head>    

<meta charset="UTF-8">    

<title>${ENV, var="JOB_NAME"}- ${BUILD_NUMBER} build log </title>    

</head>    

    

<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"    

    offset="0">    

    <table width="95%" cellpadding="0" cellspacing="0"    

        style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">    

        <tr>    

            <td><br />    

            <b><font color="#0B610B"> Build Information </font></b>    

            <hr size="2" width="100%" align="center" /></td>    

        </tr>    

        <tr>    

            <td>    

                <ul>    

                    <li> Project Name: ${PROJECT_NAME}</li>    

                    <li> Build Number: Build $ {BUILD_NUMBER} </li>    

                    <li>SVN 版本: ${SVN_REVISION}</li>    

                    <li> Trigger Reason: ${CAUSE}</li>    

                    <li>构建日志: <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>    

                    <li>构建  Url <a href="${BUILD_URL}">${BUILD_URL}</a></li>    

                    <li>工作目录 : <a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li>    

                    <li>项目  Url <a href="${PROJECT_URL}">${PROJECT_URL}</a></li>    

                </ul>    

            </td>    

        </tr>    

        <tr>    

            <td><b><font color="#0B610B">变更集</font></b>    

            <hr size="2" width="100%" align="center" /></td>    

        </tr>    

            

        <tr>    

            <td>${JELLY_SCRIPT,template="html"}<br/>    

            <hr size="2" width="100%" align="center" /></td>    

        </tr>    

           

           

    </table>    

</body>    

</html>    

 

 

 

 

 

 

 

 

 

 

 

 

4. Configure the notification email again and perform the mailbox test

 

two. Project configuration

1. Configuration of the test project

 

 

 

 

 

 

 

 

2. Select the post-build configuration   E-mail Notification    ( if the job does not appear "post-build configuration ", it may not have permission, and it can be configured only after the administrator's authorization; )

 

3. Configure Editable Email Notification ap

 

 

 

4. Increase trigger settings

 

 

 

 

 

5. Trigger settings always send emails whether the build succeeds or fails

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324871526&siteId=291194637