473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

sending emails thro SMTP server

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***@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***@domain.com"
msgMail.From = "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...............

Nov 22 '05 #1
2 1810
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***@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***@domain.com"
msgMail.From = "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...............

Nov 22 '05 #2

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.
"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***@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***@domain.com"
msgMail.From = "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...............

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
2
by: ufraf | last post by:
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...
13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
1
by: mark | last post by:
I need to send order confirmation emails through my asp.net storefront. With my Asp 3.0 sites I use cdonts with no issues. I've researched the system.web.mail asp.net way and haven't got it to...
3
by: Steve Thurston | last post by:
Hi, I'm attempting to send emails for the first time using ASP.NET, so I'm hoping there's just a beginner's error going on here for me. But my emails aren't reaching their destination, and I...
3
by: Arek | last post by:
Hey, I have a question, what are the possibilities of sending emails using ASP.net. (and VB.net) What I think is that user can send automatic reminder if he check box on the form and submit. Do...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
8
by: windandwaves | last post by:
Hi Folk I want to send out a basic newsletter from my MySql database of contacts. Does anyone know a nice and simple bit of PHP that allows me to do this? TIA - Nicolas
3
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site...
4
by: krishnakant Mane | last post by:
hello, I am a bit confused. I want to make a program that will take some data from a database and make a string of text. and send it to the respective email id of a person. next I also want to...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.