G
Guest
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(Request.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
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(Request.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