G
Guest
Greetings,
I have been searching the web like mad for a solution to my SMTP problem. I
am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a
web site I have created to the members of my organization. I think my problem
is incorrectly setting the settings on my server or an authentication
problem. Here is the code I have written to send a test message:
-----Code Begins: Sensitive Information Replaced by [SOMETHING]-----
MailAddress from = new MailAddress([ADDRESS], [NAME]);
MailAddress to = new MailAddress([ADDRESS], [NAME]);
MailAddress copy = new MailAddress([ADDRESS], [NAME]);
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the SmtpClient class.";
message.IsBodyHtml = true;
message.Body = @"Using this feature, you can send an e-mail message from an
application very easily.";
message.CC.Add(copy);
NetworkCredential authInfo = new NetworkCredential([USERNAME], [PASSWORD]);
SmtpClient client = new SmtpClient([DOMAIN NAME], 25);
client.UseDefaultCredentials = false;
client.Credentials = authInfo;
client.Send(message);
-----Code Ends-----
On Windows Server 2003, I have created an account and placed it in the SMTP
Users group and granted this group access to the SMTP Service. Under
Authentication, I checked Anonymous Access and Integrated Windows
Authentication. In the Outbound Security, I selected Integrated Windows
Authentication and provided the username and password for the account I
created previously.
When click submit to send the e-mail, this is the error I receive (sorry for
copying and pasting this long error report, but I don't know what is wrong):
-----Error Report Begins-----
Server Error in '/HfHv3' Application
--------------------------------------------------------------------------------
An established connection was aborted by the software in your host machine
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An established
connection was aborted by the software in your host machine
Source Error:
Line 88: client.UseDefaultCredentials = false;
Line 89: client.Credentials = authInfo;
Line 90: client.Send(message);
Line 91:
Line 92: //try
Source File:
c:\Inetpub\wwwroot\HfHv3\intranet\board\mailinglists\sendemail.aspx.cs
Line: 90
Stack Trace:
[SocketException (0x2745): An established connection was aborted by the
software in your host machine]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +1002146
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object
owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket&
abortSocket6, Int32 timeout) +1447736
System.Net.PooledStream.Activate(Object owningObject, Boolean async,
Int32 timeout, GeneralAsyncDelegate asyncCallback) +190
System.Net.PooledStream.Activate(Object owningObject,
GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject,
GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318
System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
System.Net.Mail.SmtpClient.GetConnection() +42
System.Net.Mail.SmtpClient.Send(MailMessage message) +1485
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
sendemail.btnSend_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\HfHv3\intranet\board\mailinglists\sendemail.aspx.cs:90
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
-----Error Report Ends-----
Any help would be greatly appreciated!! Thanks a bunch!
Eric
I have been searching the web like mad for a solution to my SMTP problem. I
am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a
web site I have created to the members of my organization. I think my problem
is incorrectly setting the settings on my server or an authentication
problem. Here is the code I have written to send a test message:
-----Code Begins: Sensitive Information Replaced by [SOMETHING]-----
MailAddress from = new MailAddress([ADDRESS], [NAME]);
MailAddress to = new MailAddress([ADDRESS], [NAME]);
MailAddress copy = new MailAddress([ADDRESS], [NAME]);
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the SmtpClient class.";
message.IsBodyHtml = true;
message.Body = @"Using this feature, you can send an e-mail message from an
application very easily.";
message.CC.Add(copy);
NetworkCredential authInfo = new NetworkCredential([USERNAME], [PASSWORD]);
SmtpClient client = new SmtpClient([DOMAIN NAME], 25);
client.UseDefaultCredentials = false;
client.Credentials = authInfo;
client.Send(message);
-----Code Ends-----
On Windows Server 2003, I have created an account and placed it in the SMTP
Users group and granted this group access to the SMTP Service. Under
Authentication, I checked Anonymous Access and Integrated Windows
Authentication. In the Outbound Security, I selected Integrated Windows
Authentication and provided the username and password for the account I
created previously.
When click submit to send the e-mail, this is the error I receive (sorry for
copying and pasting this long error report, but I don't know what is wrong):
-----Error Report Begins-----
Server Error in '/HfHv3' Application
--------------------------------------------------------------------------------
An established connection was aborted by the software in your host machine
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An established
connection was aborted by the software in your host machine
Source Error:
Line 88: client.UseDefaultCredentials = false;
Line 89: client.Credentials = authInfo;
Line 90: client.Send(message);
Line 91:
Line 92: //try
Source File:
c:\Inetpub\wwwroot\HfHv3\intranet\board\mailinglists\sendemail.aspx.cs
Line: 90
Stack Trace:
[SocketException (0x2745): An established connection was aborted by the
software in your host machine]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +1002146
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object
owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket&
abortSocket6, Int32 timeout) +1447736
System.Net.PooledStream.Activate(Object owningObject, Boolean async,
Int32 timeout, GeneralAsyncDelegate asyncCallback) +190
System.Net.PooledStream.Activate(Object owningObject,
GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject,
GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318
System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
System.Net.Mail.SmtpClient.GetConnection() +42
System.Net.Mail.SmtpClient.Send(MailMessage message) +1485
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
sendemail.btnSend_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\HfHv3\intranet\board\mailinglists\sendemail.aspx.cs:90
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
-----Error Report Ends-----
Any help would be greatly appreciated!! Thanks a bunch!
Eric