473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1815
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
4282
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
351
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
3181
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
1672
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
1963
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
394
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
3594
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
1755
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
4258
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
3075
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...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.