You could set the SMTP host name to the name of the local computer
rather than empty string
<SmptHost value="${COMPUTERNAME}" />
Cheers,
Nicko
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of TomekR
> Sent: 15 December 2005 16:32
> To: [email protected]
> Subject: SmtpAppender configuration error
>
> Hello !
>
> (I've browsed this list to avoid duplicate threads, but if
> this problem was already announced then forgive me).
> Let imagine following scenario:
>
> 1.
> my app uses smpt appender, which is configured using
> ConfigureAndWatch.
> Initially the property smtpHost is set to MyMailServer.net.
>
> Some log events occured so some e-mails was sent, what
> results, that SmtpMail.SmtpServer is set to MyMailServer.net
>
> 2.
> Then user changes mail server and sets empty string with
> intention to use local smtp server.
> The appender reloads configuration and sets its property to
> empty string.
> BUT the emails are sent directed to previous mail server !!!
> Why ? Becouse of
> that:
> (ending part of SendBuffer method)
>
> if (m_smtpHost != null && m_smtpHost.Length > 0) {
> SmtpMail.SmtpServer = m_smtpHost;
> }
>
> Since appender property i.e. smtpHost is empty, then if
> condition prevents change of SmtpServer property.
> IMO, this setting should be done unconditionally.
>
> Regards,
> --
> Tomek
>
>