Hi All.
As the first test with an ASP worked fine with my local SMTP-Service i've tried ASPX (ASP2), too.
Boom!
Here the sourcecode with which i tried
<% @Page Language="VB" %>
<% System.Net.Mail.SmtpClient %>
<% System.Net.Mail.Mailmessage %>
<%
Dim SmtpObj As New System.Net.Mail.SmtpClient
Dim MailMessage As New System.Net.Mail.MailMessage()
SmtpObj.Host = "localhost"
SmtpObj.Port = 25
MailMessage.From = New System.Net.Mail.MailAddress("kai@kaijoussen.de")
MailMessage.To.Add("kai@kaijoussen.de")
MailMessage.Subject = "Testmail"
MailMessage.IsBodyHtml = False
MailMessage.Body = "Testmail"
SmtpObj.Send(MailMessage)
Response.Write("Email was queued to disk")
%>
In smtpobj.Send() comes the error. So, it looks like a problem with ASP2, not only when trying to send to a SMTP which requires authentication but also with anonymous access!
The error i receive in the browser:
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 14: MailMessage.IsBodyHtml = True
Line 15: MailMessage.Body = "Testmail"
Line 16: SmtpObj.Send(MailMessage)
Line 17:
Line 18: Response.Write("Email was queued to disk")
|
Source File: D:\Temp\default.aspx Line: 16
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) +1002178
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) +1447768
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
ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\Temp\default.aspx:16
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2068251
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896
|
As DNN is written in ASP2 ....hm....
I'm not the programming guru, but wouldn't it be possible to use the ASP1 modules for mail?