The error message regarding relaying would seem to indicate a mail server setup problem rather than an issue connecting with the server. Are you sure that your local server is setup to allow relaying for the domains of the email address your are sending from (i.e. pretending to be).
The main issue with the System.Web.Mail library is that the SmtpHost property is global. If the application sets the SmtpHost independent of log4net then log4net should not reset it unless told to use a specific value. log4net treats the empty string as unset and therefore does not overwrite the global value of the SmtpHost. If you need a different behaviour then you can just subclass the SmtpAppender and override the ActivateOptions method to set the SmtpHost property. Cheers, Nicko > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of TomekR > Sent: 16 December 2005 08:18 > To: [email protected] > Subject: Re: SmtpAppender configuration error > > Nicko ! > > Thanks for response. > Your way almost :-) worked. > Look at the extract of my log: > -------------------------------- > log4net: SmtpHost: [BSPDEVSERVER] > log4net: SmtpMail.SmtpServer: [BSPDEVSERVER] log4net:ERROR > 2005-12-16 08:25:53 Error occurred while sending e-mail notification. > System.Web.HttpException: Could not access 'CDO.Message' object. ---> > System.Reflection.TargetInvocationException: Exception has > been thrown by the target of an invocation. ---> > System.Runtime.InteropServices.COMException > (0x8004020F): The server rejected one or more recipient > addresses. The server response was: 550 5.7.1 Unable to relay for xxx > --------------------------------- > (the square brackets are not the part of the value - they > only surround the value). > > Instead of xxx the real address was logged. The address was > valid - it's my address and it works with other server. > It seems to be SmtpMail problem, that it can't work with > machine name as smtp server name. I've checked, that with > such a setting SmtpMail is able to serve mail only to locally > defined (on the machine with local smtp) user names. > Do you have other suggestions ? > > Cheers, > -- > Tomek > >
