"Guido Kraus" wrote:
> Hi,
>
> try the following lines just before you send your message:
>
> msgMail.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
>
> msgMail.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendusername", "myusername")
>
> msg.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypassword")
>
>
> Contact your mail server administrator to obtain a valid username/password.
>
> Hope that helps,
> Guido
>
> "ufraf" wrote:
>
> > Hey i am a total newbie in .net.I'm working on an assignment to send email to
> > the adimin id that's my official id (xx.xx@something.com - the code
> > developers id) when an invalid user trys to login to the application.I have
> > to connect to my comapy's server to send emails.In the code when i give the
> > mailserver as local host the message gets stored in my queues folder.If i
> > giver the ip address of the server i want to connect to server unreachable
> > error keeps coming.I dont know if it is due to authentication issues or SMTP
> > configuration or GOD knows what else :( Here's the code:
> >
> > msgMail.To = "xx.xx@domain.com"
> > msgMail.From = "yy.yy@domian.com"
> > msgMail.Subject = "Notification on Invalid User Login into
> > System"
> > msgMail.BodyFormat = MailFormat.Html
> > strBody = "<html><body><b>Invaild User
> > Login</b></body></html>"
> > msgMail.Body = strBody
> > SmtpMail.SmtpServer = "192.168.23.240"
> > SmtpMail.Send(msgMail)
> > Response.Write("Email was qued to disk")
> >
> > error:
> > Exception Details: System.Runtime.InteropServices.COMException: The
> > transport failed to connect to the server.
> >
> > Well anydody out there with a solution coz i'm in a fix i've spent a whole
> > day trying to fix this and i'm desperate...............