473,387 Members | 3,684 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,387 software developers and data experts.

Testing Emailpage not possible

Hi,

I developed an "Contact Us" - page with VS 2005 and ASP.NET 2.0.
By clicking the send button the following code is executed:

Configuration config =
WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath);

MailMessage mailBericht = new
MailMessage(txtbxEmailadres.Text.Trim(),
config.AppSettings.Settings["contactMailAdres"].Value.Trim());
mailBericht.Subject = "Mailbericht vanaf website";
mailBericht.Body = txtbxBericht.Text + "\n" + txtbxNaam.Text.Trim()
+ "\n" + txtbxTelefoon.Text.Trim();

SmtpClient smtp = new
SmtpClient(config.AppSettings.Settings["mailserver"].Value,
int.Parse(config.AppSettings.Settings["mailPort"].Value.ToString()));

smtp.UseDefaultCredentials = true;
smtp.Send(mailBericht);
The mailserver-key contains "localhost".
The port is 1607 (but i've tried port 25 also).

I'm using the built-in webserver from VS2005 on an XP Home Edition-machine.

The codeline "smtp.Send(mailBericht);" throws the following exception:
"Smtp server returned an invalid response"

I can't figure out what 's wrong.
I guess that the problem is caused within the built-in webserver.

Is it anyway possible to send mail from the built-in webser in conjunction
with an XP Home Edition-machine?

greetings
Ruud
Oct 29 '06 #1
2 2641
By built-in web server, I assume you mean the built-in VS.Net 2005 web
server. The question is, what is the SMTP server you are trying to pass
through. Windows XP Home won't have one builtin as the nromal one is part of
IIS. Unless you're running a third-party SMTP server, then it should throw
an error just as you're seeing since there isn't a valid SMTP listener on
port 25 to give a meaningful response.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Ruud Ortmans" <Ru*********@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
Hi,

I developed an "Contact Us" - page with VS 2005 and ASP.NET 2.0.
By clicking the send button the following code is executed:

Configuration config =
WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath);

MailMessage mailBericht = new
MailMessage(txtbxEmailadres.Text.Trim(),
config.AppSettings.Settings["contactMailAdres"].Value.Trim());
mailBericht.Subject = "Mailbericht vanaf website";
mailBericht.Body = txtbxBericht.Text + "\n" + txtbxNaam.Text.Trim()
+ "\n" + txtbxTelefoon.Text.Trim();

SmtpClient smtp = new
SmtpClient(config.AppSettings.Settings["mailserver"].Value,
int.Parse(config.AppSettings.Settings["mailPort"].Value.ToString()));

smtp.UseDefaultCredentials = true;
smtp.Send(mailBericht);
The mailserver-key contains "localhost".
The port is 1607 (but i've tried port 25 also).

I'm using the built-in webserver from VS2005 on an XP Home
Edition-machine.

The codeline "smtp.Send(mailBericht);" throws the following exception:
"Smtp server returned an invalid response"

I can't figure out what 's wrong.
I guess that the problem is caused within the built-in webserver.

Is it anyway possible to send mail from the built-in webser in conjunction
with an XP Home Edition-machine?

greetings
Ruud

Oct 29 '06 #2
Thanks.

I managed the problem by sending the mail to the mailserver of my regular
provider. That works.

"Mark Fitzpatrick" wrote:
By built-in web server, I assume you mean the built-in VS.Net 2005 web
server. The question is, what is the SMTP server you are trying to pass
through. Windows XP Home won't have one builtin as the nromal one is part of
IIS. Unless you're running a third-party SMTP server, then it should throw
an error just as you're seeing since there isn't a valid SMTP listener on
port 25 to give a meaningful response.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Ruud Ortmans" <Ru*********@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
Hi,

I developed an "Contact Us" - page with VS 2005 and ASP.NET 2.0.
By clicking the send button the following code is executed:

Configuration config =
WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath);

MailMessage mailBericht = new
MailMessage(txtbxEmailadres.Text.Trim(),
config.AppSettings.Settings["contactMailAdres"].Value.Trim());
mailBericht.Subject = "Mailbericht vanaf website";
mailBericht.Body = txtbxBericht.Text + "\n" + txtbxNaam.Text.Trim()
+ "\n" + txtbxTelefoon.Text.Trim();

SmtpClient smtp = new
SmtpClient(config.AppSettings.Settings["mailserver"].Value,
int.Parse(config.AppSettings.Settings["mailPort"].Value.ToString()));

smtp.UseDefaultCredentials = true;
smtp.Send(mailBericht);
The mailserver-key contains "localhost".
The port is 1607 (but i've tried port 25 also).

I'm using the built-in webserver from VS2005 on an XP Home
Edition-machine.

The codeline "smtp.Send(mailBericht);" throws the following exception:
"Smtp server returned an invalid response"

I can't figure out what 's wrong.
I guess that the problem is caused within the built-in webserver.

Is it anyway possible to send mail from the built-in webser in conjunction
with an XP Home Edition-machine?

greetings
Ruud


Oct 31 '06 #3

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

Similar topics

4
by: Hugh Cowan | last post by:
Hello, I don't program full-time (anymore), but I do try and stay on-top of the latest technologies and like most are always trying to upgrade my skills and remain current (as much as is...
3
by: Andrew | last post by:
Hi, I am thinking about ways for efficient techniques for isolation testing. Here is the problem as I see it: Complex OO systems are designed with massive number of dependencies between modules...
56
by: Don G | last post by:
I currently have IE6 and Firefox installed on my machine, and I switch between the two when testing web sites I am working on. It is my understanding that IE5 is still pretty common. Is this...
0
by: Jonathan Allen | last post by:
We have found that our method of testing does not match traditional text-book methodologies. I decided to write a short white paper on it so that I could get your opinions. Does anyone else use...
14
by: | last post by:
Hi! I'm looking for unit-testing tools for .NET. Somthing like Java has --> http://www.junit.org regards, gicio
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
6
by: Dick | last post by:
I’d appreciate some advice regarding unit tests. My questions are general in nature but (as usual) best conveyed via a (simplified) example: I have a table that contains two columns – the...
24
by: David | last post by:
Hi list. What strategies do you use to ensure correctness of new code? Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do...
0
by: Matthew Fitzgibbons | last post by:
I'm by no means a testing expert, but I'll take a crack at it. Casey McGinty wrote: I've never run into this. Rule of thumb: always separate software from hardware. Write mock classes or...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.