logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parrish, Ken" <KParr...@gomez.com>
Subject SmtpAppender To: addresses ...
Date Wed, 02 Apr 2008 14:10:24 GMT
Log4net Users,


I am using the SmtpAppender.  The documentation explains that the <to>
field can contain a list of e-mail addresses separated by semi-colons.
However, doing so, raises an exception in log4net:


<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">

      <to value="xxx@yyy.com;aaa@bbb.net" />

      <from value="Program-Monitor@gomez.com" />

      <subject value="Program-Monitor Operational Notification" />

      <smtpHost value="smtpmail.mydomain.com" />

      <layout type="log4net.Layout.PatternLayout">

            <param name="ConversionPattern" value="%date{yyyy-MM-dd
HH:mm:ss.fff} [%-2thread] [%-5level] [%logger]
%message%newline%exception" />




Generates the following exception:


2008-04-02 10:07:28.777 [1 ] [ERROR] [SmtpLog] MyTest.TestLogger: SMTP
Log test - 2.

log4net:ERROR [SmtpAppender] Error occurred while sending e-mail

System.FormatException: The specified string is not in the form required
for an e-mail address.

   at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32&
offset, String& displayName)

   at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32&

   at System.Net.Mail.MailAddressCollection.ParseValue(String addresses)

   at System.Net.Mail.MailAddressCollection.Add(String addresses)

   at log4net.Appender.SmtpAppender.SendEmail(String messageBody)

   at log4net.Appender.SmtpAppender.SendBuffer(LoggingEvent[] events)

Press any key to continue . . .


IF, I use a comma separated list of e-mail addresses, it does work.  So,
this is a simple work-around.  However, it contradicts the
documentation.  Has anyone else experienced a similar problem?  Is the
documentation wrong?  Am I making a mistake somewhere?




Ken Parrish

Gomez, Inc.

View raw message