Skip to content

M_NChronicle_SMTP_Configuration_SmtpChronicleLibraryConfiguration_WithBodyFromFile

Andrew James edited this page Aug 3, 2017 · 1 revision

SmtpChronicleLibraryConfiguration.WithBodyFromFile Method

Specify from the specified file path the HTML email body in which records are sent.

Namespace: NChronicle.SMTP.Configuration
Assembly: NChronicle.SMTP (in NChronicle.SMTP.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public void WithBodyFromFile(
	string path
)

VB

Public Sub WithBodyFromFile ( 
	path As String
)

F#

member WithBodyFromFile : 
        path : string -> unit 

Parameters

 

path
Type: System.String
The file path from which to load the HTML.

Remarks

This fully supports the token syntax supported by WithBody(String). See documentation for WithBody(String) for more information on formatting syntax and options. The default HTML email body is:

 <body style="text-align: center; background-color: #333;">
    <table style="background-color: #CCC; color: #333; font-family: 'Arial'; width: 800px; //margin:/ 40px auto; text-align: left" cell-spacing="0">
        <tr><td style="padding: 20px 20px 30px 20px;">
            <h2 style="margin: 0;"><strong>{LVL}</strong> level record occurred</h2>
            at <strong>{%yyyy/MM/dd HH:mm:ss.fff}</strong>  
        </td></tr>
        <tr><td style="padding: 10px 20px; background-color: #D8D8D8">
        <strong>{MSG}{MSG!?{EMSG}}</strong>
        </td></tr>
        {EXC?
        <tr><td style="padding: 10px 20px; background-color: #D8D8D8; color: #555;">
        {EXC}
        </td></tr>
        }
        {TAGS?
        <tr><td style="padding: 10px 20px; background-color: #D8D8D8; color: #666;">
            This record has the following tags:<br />{TAGS|, }
        </td></tr>
        }
        <tr><td style="padding: 20px 20px 30px 20px; text-align: center;">
        <small>Brought to you by NChronicle.SMTP.</small>
        </td></tr>
    </table>
</body>

See Also

Reference

SmtpChronicleLibraryConfiguration Class
NChronicle.SMTP.Configuration Namespace

Clone this wiki locally