Hi all,
I am trying to send web based email thru ASP.NET and all the outbound messages get stuck in the queue folder.
The same server successfully sends email using classic ASP. It's just .NET that it has a problem with.
Here is a sample of my code in C#:
<script language="C#" runat="server">
void Page_Load(Object src, EventArgs E){
try
{
MailMessage objEmail = new MailMessage();
objEmail.To = ("meckeard2000@yahoo.com");
objEmail.From = ("meckeard2000@yahoo.com");
objEmail.Subject = ("This is a test email");
objEmail.Body = ("test");
SmtpMail.Send(objEmail);
Response.Write ("email sent");
}
catch
{
Response.Write ("email NOT sent");
}
}
</script>
I have tried both C# and VB.NET. Same results. The page does not throw an error and SMTP is running on the server (Windows 2000 server). Exchange is 5.5 running on its own server.
I searched the web and found many articles that were similar, but none offered any help.
Thanks,
Mark
I am trying to send web based email thru ASP.NET and all the outbound messages get stuck in the queue folder.
The same server successfully sends email using classic ASP. It's just .NET that it has a problem with.
Here is a sample of my code in C#:
<script language="C#" runat="server">
void Page_Load(Object src, EventArgs E){
try
{
MailMessage objEmail = new MailMessage();
objEmail.To = ("meckeard2000@yahoo.com");
objEmail.From = ("meckeard2000@yahoo.com");
objEmail.Subject = ("This is a test email");
objEmail.Body = ("test");
SmtpMail.Send(objEmail);
Response.Write ("email sent");
}
catch
{
Response.Write ("email NOT sent");
}
}
</script>
I have tried both C# and VB.NET. Same results. The page does not throw an error and SMTP is running on the server (Windows 2000 server). Exchange is 5.5 running on its own server.
I searched the web and found many articles that were similar, but none offered any help.
Thanks,
Mark