sending email 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...............
 
A

anjanadevicr

hai ,

i think first u have to give the string HELO to the smtp server

only then it will start connecting
once u r msg is over then end the mail by "."

i think this will help u


cheers,
vidhyasudha C.R

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
J

Joachim Roppert

As long as you're using the .Net classes, you don't need to talk to the SMTP
server at such a low level :)
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top