小编squ*_*are的帖子

如何在nlog中发送彩色邮件

下面的配置是我的 nlog 设置,这个设置发送邮件是可以的。

<target name="mail" xsi:type="Mail"
            smtpServer="SMTP SERVER"
            smtpPort="25"
            smtpAuthentication="None"   
            enableSsl="false"   
            from="email address"  
            to="email address"
            html="true"
            encoding="UTF-8"
            addNewLines="true"
            replaceNewlineWithBrTagInHtml ="true"
            subject="SYSTEM MESSAGE?${machinename} ? ${shortdate} ${time} create ${level} message "
            header="========================================================================="
            body="${newline} 
            time?${longdate} ${newline}${newline}
            Log level?${level:uppercase=true} ${newline}${newline}
            Logger?${logger} ${newline}${newline}
            Source?${callsite:className=true} ${newline}${newline}
            Exception?${exception:format=type} ${newline}${newline}
            Error message?${message} ${newline}${newline}"     
            footer="========================================================================="
    />

</targets>

 <rules>
    <logger name="*" minlevel="Fatal" writeTo="mail" />
 </rules>
Run Code Online (Sandbox Code Playgroud)

但我想发送彩色邮件。如何设置configure?

c# nlog html-email

8
推荐指数
1
解决办法
1386
查看次数

如何在python中将"ASCII"转换为"hex"

如何在python中将"ASCII"转换为"HEX"

我有一个文件需要阅读.但使用下面的代码它只能显示ASCII

with open('Hello.DAT','rb') as f:
    data= f.read()  
    print(data)
Run Code Online (Sandbox Code Playgroud)

它可以以这种格式打印数据:

01201602180000020000000007000000000054000000000000\X0

如何将此数据转换为HEX值,如下所示:

30 31 32 30 31 36 30 32 31 38 30 30 30 30 30 32 30 30 30 30 30 30 30 30 37 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 5c 78 30

python

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

html-email ×1

nlog ×1

python ×1