A
antonyliu2002
I've set up the virtual smtp server on my IIS 5.1 like so:
1. Assign IP address to "All Unassigned", and listen to port 25.
2. Access Connection granted to "127.0.0.1".
3. Relay only allow "127.0.0.1".
4. Authentication: "Anonymous access" only.
5. Outbound connection listen to TCP 25.
Besides,
6. I've opened up port 25 in my Linksys WRT45G wireless router.
7. I've made port 25 an exception in my WinXP Pro built-in firewall.
8. Unblocked port 25 in McAfee 8.0 enterprise edition.
I used the following code, and
Response.Write("Your E-mail has been sent sucessfully - Thank You")
is executed and I don't see any exception.
However, the mail never arrived!
So, what's the problem?
Is it possible to configure the virtual SMTP server to listen to a
non-standard port for just sending email? I heard that my ISP SBC DSL
blocks port 25. If this is possible, how to let it listen to a
different port?
***** The code I use ***********
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
Sub btnSubmit_Click(sender as object, e as EventArgs)
If Page.IsValid Then
' Create a new blank MailMessage
Dim mailMessage As MailMessage = new MailMessage ()
mailMessage.From = txtFrom.Text
mailMessage.To = txtTo.Text
mailMessage.Cc = txtCc.Text
mailMessage.Subject = "Test SMTP Message Send using port"
mailMessage.Body = txtName.Text & ", " &txtComments.Text
SmtpMail.SmtpServer = "127.0.0.1"
Try
SmtpMail.Send(mailMessage)
Response.Write("Your E-mail has been sent sucessfully - Thank You")
Catch ex As Exception
Response.Write(("The following exception occurred: " +
ex.ToString()))
'check the InnerException
While Not (ex.InnerException Is Nothing)
Response.Write("--------------------------------")
Response.Write(("The following InnerException reported: "
+ ex.InnerException.ToString()))
ex = ex.InnerException
End While
End Try
End If
End Sub
</script>
The HTML that follows this code snippet is not pasted.
1. Assign IP address to "All Unassigned", and listen to port 25.
2. Access Connection granted to "127.0.0.1".
3. Relay only allow "127.0.0.1".
4. Authentication: "Anonymous access" only.
5. Outbound connection listen to TCP 25.
Besides,
6. I've opened up port 25 in my Linksys WRT45G wireless router.
7. I've made port 25 an exception in my WinXP Pro built-in firewall.
8. Unblocked port 25 in McAfee 8.0 enterprise edition.
I used the following code, and
Response.Write("Your E-mail has been sent sucessfully - Thank You")
is executed and I don't see any exception.
However, the mail never arrived!
So, what's the problem?
Is it possible to configure the virtual SMTP server to listen to a
non-standard port for just sending email? I heard that my ISP SBC DSL
blocks port 25. If this is possible, how to let it listen to a
different port?
***** The code I use ***********
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
Sub btnSubmit_Click(sender as object, e as EventArgs)
If Page.IsValid Then
' Create a new blank MailMessage
Dim mailMessage As MailMessage = new MailMessage ()
mailMessage.From = txtFrom.Text
mailMessage.To = txtTo.Text
mailMessage.Cc = txtCc.Text
mailMessage.Subject = "Test SMTP Message Send using port"
mailMessage.Body = txtName.Text & ", " &txtComments.Text
SmtpMail.SmtpServer = "127.0.0.1"
Try
SmtpMail.Send(mailMessage)
Response.Write("Your E-mail has been sent sucessfully - Thank You")
Catch ex As Exception
Response.Write(("The following exception occurred: " +
ex.ToString()))
'check the InnerException
While Not (ex.InnerException Is Nothing)
Response.Write("--------------------------------")
Response.Write(("The following InnerException reported: "
+ ex.InnerException.ToString()))
ex = ex.InnerException
End While
End Try
End If
End Sub
</script>
The HTML that follows this code snippet is not pasted.