sending emails thro SMTP server

G

Guest

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 ([email protected] - 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 = "(e-mail address removed)"
msgMail.From = "(e-mail address removed)"
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...............
 
G

Guest

Hey Guido,
Thanx for replying.Yeah i tried the code u sent but it didn't work.So i have
to get a vaild user id and password from my sys admin guys.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top