By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

Mail sent through IIS virtual SMTP server not arriving

P: n/a
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.

Mar 2 '06 #1
Share this Question
Share on Google+
34 Replies


P: n/a
you probably need to configure the smtp server to correctly forward mail to
your isp's smtp server. does the isp smtp require authenication? does it
require the from match authenication?

-- bruce (sqlwork.com)
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
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.

Mar 2 '06 #2

P: n/a

2/8/2006

http://spaces.msn.com/sholliday/
Check this blog.

This will help you with the coding side of the issue. I have 1.1 and
2.0 code.

as far as the IIS setup
Then check the wwwroot\mail\queue folder.

If items are "stuck" in here, then the issue is your smarthost setup
(the stuff you describe below).
Sometimes its a tug and pull affair, and it depends on the end isp you
have.

my smtp.nc.rr.com was finicky.


<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
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.

Mar 2 '06 #3

P: n/a
Best resource for 1.1 mail issues http://www.systemwebmail.com
For 2.0 http://www.systemnetmail.com

Mar 2 '06 #4

P: n/a
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
you probably need to configure the smtp server to correctly forward mail to
your isp's smtp server. does the isp smtp require authenication? does it
require the from match authenication?

-- bruce (sqlwork.com)
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
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.


Mar 2 '06 #5

P: n/a
Hi, Sloan,

Thanks. I just checked \Inetpub\mailroot\Queue\. Indeed, all of the
messages are lying there. So apparently, they were not sent.

Don't know what went wrong. So, you think it has to do with my ISP:
SBC DSL?

I know that they block port 25. So, is it possible to set up my IIS
SMTP server to listen to a nonstandard port for just outgoing messages?
sloan wrote:
2/8/2006

http://spaces.msn.com/sholliday/
Check this blog.

This will help you with the coding side of the issue. I have 1.1 and
2.0 code.

as far as the IIS setup
Then check the wwwroot\mail\queue folder.

If items are "stuck" in here, then the issue is your smarthost setup
(the stuff you describe below).
Sometimes its a tug and pull affair, and it depends on the end isp you
have.

my smtp.nc.rr.com was finicky.


<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
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.


Mar 2 '06 #6

P: n/a
re:
By quoting "sent", I meant that at least it looks like to have been sent.
The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com... Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
you probably need to configure the smtp server to correctly forward mail to
your isp's smtp server. does the isp smtp require authenication? does it
require the from match authenication?

-- bruce (sqlwork.com)
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
> 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.
>

Mar 2 '06 #7

P: n/a
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404
18:28:41 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:28:41 130.126.83.20 GET /favicon.ico 404
18:29:24 130.126.83.20 GET /sendmail/vmailman.aspx 200
18:29:24 130.126.83.20 GET /favicon.ico 404
18:29:43 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:29:43 130.126.83.20 GET /favicon.ico 404
18:31:35 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:31:35 130.126.83.20 GET /favicon.ico 404
18:31:39 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:31:39 130.126.83.20 GET /favicon.ico 404
18:31:41 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:31:41 130.126.83.20 GET /favicon.ico 404
18:31:42 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:31:42 130.126.83.20 GET /favicon.ico 404
18:34:02 130.126.83.20 GET /sendmail/vmailman.aspx 200
18:34:02 130.126.83.20 GET /favicon.ico 404
18:34:18 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:34:18 130.126.83.20 GET /favicon.ico 404
18:44:53 130.126.83.20 GET /sendmail/vmailman.aspx 200
18:44:53 130.126.83.20 GET /favicon.ico 404
18:45:42 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:45:42 130.126.83.20 GET /favicon.ico 404
18:48:01 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:48:01 130.126.83.20 GET /favicon.ico 404
18:50:32 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:50:32 130.126.83.20 GET /favicon.ico 404
18:51:09 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:51:09 130.126.83.20 GET /favicon.ico 404
18:51:10 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:51:10 130.126.83.20 GET /favicon.ico 404
19:06:51 130.126.83.20 POST /sendmail/vmailman.aspx 200
19:06:51 130.126.83.20 GET /favicon.ico 404
22:30:59 194.72.238.61 HEAD /iisstart.asp 200

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33- -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47- -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34- -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
you probably need to configure the smtp server to correctly forward mail to
your isp's smtp server. does the isp smtp require authenication? does it
require the from match authenication?

-- bruce (sqlwork.com)
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
> 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.
>


Mar 3 '06 #8

P: n/a
re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.
I just checked the logfile like you instructed.
You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote: re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
you probably need to configure the smtp server to correctly forward mail to
your isp's smtp server. does the isp smtp require authenication? does it
require the from match authenication?

-- bruce (sqlwork.com)
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
> 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.
>

Mar 3 '06 #9

P: n/a
Yes, I did notice that I was showing you something different from what
you wanted.

But I do not have anything under LogFiles except W3SVC1.

I probably did not check the log option for my virtual SMTP server.
Will have to do it tomorrow. I don't have access to my server right
now.

Thanks for your kindness.

Juan T. Llibre wrote:
re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
> you probably need to configure the smtp server to correctly forward mail to
> your isp's smtp server. does the isp smtp require authenication? does it
> require the from match authenication?
>
> -- bruce (sqlwork.com)
>
>
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> > 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 SBCDSL
> > 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.
> >


Mar 3 '06 #10

P: n/a
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.

I think this has something to do with the blocking of port 25 by my
ISP, SBC Yahoo DSL.

Too bad that the .Net SmtpMail class does not let us set the port
number. If it did, then I could probably just let the smtp server
listen to a nonstandard port just for outgoing mail.


Juan T. Llibre wrote:
re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
> you probably need to configure the smtp server to correctly forward mail to
> your isp's smtp server. does the isp smtp require authenication? does it
> require the from match authenication?
>
> -- bruce (sqlwork.com)
>
>
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> > 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 SBCDSL
> > 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.
> >


Mar 3 '06 #11

P: n/a
Hi, Juan,

I got the smtp server log as follows. The code is 250, which according
to what you said meant that the mail has been sent successfully. But
the mail never arrived.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-03 05:44:39
#Fields: time c-ip cs-method cs-uri-stem sc-status
05:44:39 127.0.0.1 HELO - 250
05:44:39 127.0.0.1 MAIL - 250
05:44:39 127.0.0.1 RCPT - 250
05:44:39 127.0.0.1 DATA - 250
05:44:39 127.0.0.1 QUIT - 0
05:50:26 127.0.0.1 HELO - 250
05:50:26 127.0.0.1 MAIL - 250
05:50:26 127.0.0.1 RCPT - 250
05:50:26 127.0.0.1 DATA - 250
05:50:26 127.0.0.1 QUIT - 0

Under Inetpub/mailroot/Queue, the email messages are all sleeping
there.

This is one of them:

Received: from jzgwxp ([127.0.0.1]) by jzgwxp with Microsoft
SMTPSVC(6.0.2600.2180);
Thu, 2 Mar 2006 12:34:18 -0600
thread-index: AcY+J+pQSe3Rk0ZnTkyyqJ2qLvMyog==
Thread-Topic: Test SMTP Message Send using port
From: <an***********@yahoo.com>
To: <an***********@gmail.com>
Cc:
Subject: Test SMTP Message Send using port
Date: Thu, 2 Mar 2006 12:34:18 -0600
Message-ID: <002601c63e27$ea508530$1f12fea9@jzgwxp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Return-Path: an***********@yahoo.com
X-OriginalArrivalTime: 02 Mar 2006 18:34:18.0273 (UTC)
FILETIME=[EA551910:01C63E27]

Wassup, man?
Juan T. Llibre wrote:
re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
> you probably need to configure the smtp server to correctly forward mail to
> your isp's smtp server. does the isp smtp require authenication? does it
> require the from match authenication?
>
> -- bruce (sqlwork.com)
>
>
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> > 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 SBCDSL
> > 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.
> >


Mar 3 '06 #12

P: n/a
re:
Too bad that the .Net SmtpMail class does not let us set the port number.
But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.

I think this has something to do with the blocking of port 25 by my
ISP, SBC Yahoo DSL.

Too bad that the .Net SmtpMail class does not let us set the port
number. If it did, then I could probably just let the smtp server
listen to a nonstandard port just for outgoing mail.


Juan T. Llibre wrote: re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
> you probably need to configure the smtp server to correctly forward mail to
> your isp's smtp server. does the isp smtp require authenication? does it
> require the from match authenication?
>
> -- bruce (sqlwork.com)
>
>
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> > 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.
> >

Mar 3 '06 #13

P: n/a
It does look like your ISP is blocking port 25.
Read my previous post and test using a different port.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@t39g2000cwt.googlegro ups.com...
Hi, Juan,

I got the smtp server log as follows. The code is 250, which according
to what you said meant that the mail has been sent successfully. But
the mail never arrived.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-03 05:44:39
#Fields: time c-ip cs-method cs-uri-stem sc-status
05:44:39 127.0.0.1 HELO - 250
05:44:39 127.0.0.1 MAIL - 250
05:44:39 127.0.0.1 RCPT - 250
05:44:39 127.0.0.1 DATA - 250
05:44:39 127.0.0.1 QUIT - 0
05:50:26 127.0.0.1 HELO - 250
05:50:26 127.0.0.1 MAIL - 250
05:50:26 127.0.0.1 RCPT - 250
05:50:26 127.0.0.1 DATA - 250
05:50:26 127.0.0.1 QUIT - 0

Under Inetpub/mailroot/Queue, the email messages are all sleeping
there.

This is one of them:

Received: from jzgwxp ([127.0.0.1]) by jzgwxp with Microsoft
SMTPSVC(6.0.2600.2180);
Thu, 2 Mar 2006 12:34:18 -0600
thread-index: AcY+J+pQSe3Rk0ZnTkyyqJ2qLvMyog==
Thread-Topic: Test SMTP Message Send using port
From: <an***********@yahoo.com>
To: <an***********@gmail.com>
Cc:
Subject: Test SMTP Message Send using port
Date: Thu, 2 Mar 2006 12:34:18 -0600
Message-ID: <002601c63e27$ea508530$1f12fea9@jzgwxp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Return-Path: an***********@yahoo.com
X-OriginalArrivalTime: 02 Mar 2006 18:34:18.0273 (UTC)
FILETIME=[EA551910:01C63E27]

Wassup, man?
Juan T. Llibre wrote:
re:
But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
By quoting "sent", I meant that at least it looks like to have been sent.


The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type of log.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks, Bruce.

I know that I won't have any problem for my application in sending and
receiving email if I simply use the SMTP server of my ISP. I tried it,
and it worked perfectly fine. And in this case, I don't have do
anything about the virtual SMTP server on my IIS 5.1.

But, I am trying to test if I can send email in my web application
through the IIS virtual SMTP server only.

So if I end up having to forward to my ISP's SMTP server, it'll beat my
objective, plus, I could have just used my ISP's SMTP service.

So, any idea about why I am not receiving the mail "sent" from the
virtual SMTP? By quoting "sent", I meant that at least it looks like
to have been sent.

Bruce Barker wrote:
> you probably need to configure the smtp server to correctly forward mail to
> your isp's smtp server. does the isp smtp require authenication? does it
> require the from match authenication?
>
> -- bruce (sqlwork.com)
>
>
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> > 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.
> >

Mar 3 '06 #14

P: n/a
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

Quote from
http://msdn2.microsoft.com/en-us/lib...mtpclient.aspx

<quote>
SmtpClient Class
Note: This class is new in the .NET Framework version 2.0.
Allows applications to send e-mail by using the Simple Mail Transfer
Protocol (SMTP).

Namespace: System.Net.Mail
Assembly: System (in system.dll)
</quote>

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Thanks.

Juan T. Llibre wrote:
re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.

I think this has something to do with the blocking of port 25 by my
ISP, SBC Yahoo DSL.

Too bad that the .Net SmtpMail class does not let us set the port
number. If it did, then I could probably just let the smtp server
listen to a nonstandard port just for outgoing mail.


Juan T. Llibre wrote:
re:
> But, I am trying to test if I can send email in my web application
> through the IIS virtual SMTP server only.

I just checked the logfile like you instructed.


You checked the HTTP log ( \%windir%\system32\LogFiles\W3SVC1 ),
but not the SMTP log.

The line :
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200


tells you that you POSTed to sendmail.
It doesn't tell you what the smtp server did with that POST.

Please check the \%windir%\system32\LogFiles\smtpsvc1 logs.
( and send the last 8 lines of today's log... )


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hi, Juan,

Thanks, I just checked the logfile like you instructed. And here is a
part of it. You will see GET /favicon.ico 404 in the log. And here is
a dicussion of it:

http://www.webmasterworld.com/forum39/104.htm

And for the definition of the HTTP code 200, see here:

http://64.233.179.104/search?q=cache...s&ct=clnk&cd=1

So, given the log below, could you diagnose what problem it is?

Thanks.

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-03-02 18:25:16
#Fields: time c-ip cs-method cs-uri-stem sc-status
18:25:16 130.126.83.20 POST /sendmail/vmailman.aspx 200
18:25:16 130.126.83.20 GET /favicon.ico 404

Juan T. Llibre wrote:
re:
> By quoting "sent", I meant that at least it looks like to have beensent.

The way to find out, for sure, is to turn on smtp logging.

To turn on logging, open the IIS Manager,
and select the Default SMTP Server's properties.

You'll see the option for turning it on and for selecting the type oflog.
Clicking the Properties and then the Advanced button lets you select the fields to log.

The log, by default, will be stored at \windowsdir\system32\LogFiles\smtpsvc1

You should see entries like :
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 HELO 250 33 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 MAIL 250 47 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 RCPT 250 34 - -
2006-03-01 14:58:32 111.111.111.111 smtpservername SMTPSVC1 0 DATA 250 125 - -

If the mail packet was successfully sent, the success code is 250.

Any other code means some sort of problem
which prevented the mail from getting sent.

Check that...and let us know what you see after you attempt to send mail.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
> Thanks, Bruce.
>
> I know that I won't have any problem for my application in sending and
> receiving email if I simply use the SMTP server of my ISP. I triedit,
> and it worked perfectly fine. And in this case, I don't have do
> anything about the virtual SMTP server on my IIS 5.1.
>
> But, I am trying to test if I can send email in my web application
> through the IIS virtual SMTP server only.
>
> So if I end up having to forward to my ISP's SMTP server, it'll beat my
> objective, plus, I could have just used my ISP's SMTP service.
>
> So, any idea about why I am not receiving the mail "sent" from the
> virtual SMTP? By quoting "sent", I meant that at least it looks like
> to have been sent.
>
> Bruce Barker wrote:
>> you probably need to configure the smtp server to correctly forward mail to
>> your isp's smtp server. does the isp smtp require authenication? does it
>> require the from match authenication?
>>
>> -- bruce (sqlwork.com)
>>
>>
>> <an***********@yahoo.com> wrote in message
>> news:11**********************@e56g2000cwe.googlegr oups.com...
>> > 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 toa
>> > 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.
>> >
>


Mar 3 '06 #15

P: n/a
re:
I am using .Net Framework 1.1
Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote: re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


Mar 3 '06 #16

P: n/a
Hey, Juan,

I thought that it would work this time. But the mails are still not
sent!

I am using port number 5181. I have done the following:

1. opened up this port with my Linksys WRT54G wireless router.
2. make port 5181 an exception in my WinXP Pro built-in firewall.
3. opened up this port in McAfee 8.0 Enterprise edition.
4. in Outbound connections of the SMTP properties, I set the SMTP to
listen to port 5181.
5. in the General tab, for "All unassigned", I click "Advanced" and
assigned port 5181.

Still, the messages are queued up under Inetput/mailroot/Queue/. There
is no exception.

It did not work even after I did this, i.e., on the Security tab of the
SMTP properties, I added my username as well ASPNET to "Grant operator
permissions to these windows user accounts." Of course,
'administrator' is there by default.

Hmm, kinda frustrated.

Look, this is my current code (Again, the HTML is not pasted):

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

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
"5181")
SmtpMail.SmtpServer = "127.0.0.1"
'SmtpMail.Send(mail)

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("--------------------------------<br/>")
Response.Write(("The following InnerException reported: "
+ ex.InnerException.ToString()) + "<br/>")
ex = ex.InnerException
End While
End Try
End If
End Sub

Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';" title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you needto
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONTface=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 3 '06 #17

P: n/a
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';" title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you needto
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONTface=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 3 '06 #18

P: n/a
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@t39g2000cwt.googlegr oups.com...
Hey, Juan,

I thought that it would work this time. But the mails are still not
sent!

I am using port number 5181. I have done the following:

1. opened up this port with my Linksys WRT54G wireless router.
2. make port 5181 an exception in my WinXP Pro built-in firewall.
3. opened up this port in McAfee 8.0 Enterprise edition.
4. in Outbound connections of the SMTP properties, I set the SMTP to
listen to port 5181.
5. in the General tab, for "All unassigned", I click "Advanced" and
assigned port 5181.

Still, the messages are queued up under Inetput/mailroot/Queue/. There
is no exception.

It did not work even after I did this, i.e., on the Security tab of the
SMTP properties, I added my username as well ASPNET to "Grant operator
permissions to these windows user accounts." Of course,
'administrator' is there by default.

Hmm, kinda frustrated.

Look, this is my current code (Again, the HTML is not pasted):

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

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
"5181")
SmtpMail.SmtpServer = "127.0.0.1"
'SmtpMail.Send(mail)

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("--------------------------------<br/>")
Response.Write(("The following InnerException reported: "
+ ex.InnerException.ToString()) + "<br/>")
ex = ex.InnerException
End While
End Try
End If
End Sub

Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 3 '06 #19

P: n/a
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
Too bad that the .Net SmtpMail class does not let us set the port number.


But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 3 '06 #20

P: n/a
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IPis assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
>Too bad that the .Net SmtpMail class does not let us set the port number.

But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample codein the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptionswhich
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad thatthe .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; Butit does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set inyour
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you wantin the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 3 '06 #21

P: n/a
re:
So, it looks like that remote servers do not accept my mail.
If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote: Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1


Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
re:
>Too bad that the .Net SmtpMail class does not let us set the port number.

But it does allow you to do that :

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

Of course, for that to work you must set IIS's SMTP server
to the same port you set in your code. You can use any TCP port.

To do that, view the Properties of the Default SMTP Server;
click the "Delivery" tab; click the "Outbound Connections" button;
and set the port number you want in the "Tcp port" box.

That will get around your ISP's blockage of port 25.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.


------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 3 '06 #22

P: n/a
> The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.


Dont; forget, though that some of the more anal ISPs (ie, AOL), require not
only that the fully-qualified domain name (ie, mail.mydomain.net) map back
to the sending server via NS lookups, but also that the reverse DNS resolve
back to the mail server, which many ISPs refuse to do.
Mar 3 '06 #23

P: n/a
That's why zoneedit.com and similar dynamic dns services are a life saver.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Gabriel Magaņa" <no*****@no-spam.com> wrote in message
news:eE**************@TK2MSFTNGP15.phx.gbl...
The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.


Dont; forget, though that some of the more anal ISPs (ie, AOL), require not only that the
fully-qualified domain name (ie, mail.mydomain.net) map back to the sending server via NS lookups,
but also that the reverse DNS resolve back to the mail server, which many ISPs refuse to do.

Mar 3 '06 #24

P: n/a
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
re:
So, it looks like that remote servers do not accept my mail.


If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to yourmachine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
>I am using .Net Framework 1.1

Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message'object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
> re:
> >Too bad that the .Net SmtpMail class does not let us set the port number.
>
> But it does allow you to do that :
>
> static void ChangePort()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
>
> //set the addresses
> mail.From = new MailAddress("me@mycompany.com");
> mail.To.Add("yo*@yourcompany.com");
>
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
>
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
>
> //to change the port (default is 25), we set the port property
> smtp.Port = 587;
> smtp.Send(mail);
> }
>
> Of course, for that to work you must set IIS's SMTP server
> to the same port you set in your code. You can use any TCP port.
>
> To do that, view the Properties of the Default SMTP Server;
> click the "Delivery" tab; click the "Outbound Connections" button;
> and set the port number you want in the "Tcp port" box.
>
> That will get around your ISP's blockage of port 25.
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> Hi, Juan,
>
> Now I am having the typical "Could not access 'CDO.Message' object"and
> "The transport failed to connect to the server" exceptions.

------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONTface=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I knownothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 3 '06 #25

P: n/a
> That's why zoneedit.com and similar dynamic dns services are a life saver.

Yeh, but my point is that they do not do reverse-DNS lookups. For example,
do a nslookup for gmagana.dyndns.org. Then do an nslookup for the IP
returned (the reverse-DNS lookup).... They will not match. ISPs like AOL
require these two to match.
Mar 3 '06 #26

P: n/a
re:
As a matter of fact, I do have a domain name from dnsexit.com.
Not sure how to go about this.
If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote: re:
So, it looks like that remote servers do not accept my mail.


If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
>I am using .Net Framework 1.1

Youi'll find sample code for changing the port number under system.web.amil here :

http://systemwebmail.com/faq/2.9.aspx

Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);

There's VB.NET sample code in the same page.

Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.

There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi, Juan,

Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
available with .Net framework 2.0

I am using .Net Framework 1.1

I know nothing about 2.0 at this point of time. Is there any way to go
around this?

Juan T. Llibre wrote:
> re:
> >Too bad that the .Net SmtpMail class does not let us set the port number.
>
> But it does allow you to do that :
>
> static void ChangePort()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
>
> //set the addresses
> mail.From = new MailAddress("me@mycompany.com");
> mail.To.Add("yo*@yourcompany.com");
>
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
>
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
>
> //to change the port (default is 25), we set the port property
> smtp.Port = 587;
> smtp.Send(mail);
> }
>
> Of course, for that to work you must set IIS's SMTP server
> to the same port you set in your code. You can use any TCP port.
>
> To do that, view the Properties of the Default SMTP Server;
> click the "Delivery" tab; click the "Outbound Connections" button;
> and set the port number you want in the "Tcp port" box.
>
> That will get around your ISP's blockage of port 25.
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> Hi, Juan,
>
> Now I am having the typical "Could not access 'CDO.Message' object" and
> "The transport failed to connect to the server" exceptions.

------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers&nbsp;for both the "Could not access 'CDO.Message' object"
<BR>and&nbsp;"The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time.&nbsp; Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
{<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
//set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
"this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
//to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
= 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
"Outbound Connections" button;<BR>&gt; and set the port number you want in the
"Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
href="mailto:an***********@yahoo.com"><FONT face=Arial
size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
message<BR>&gt; </FONT><A
href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
face=Arial
size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>

------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 3 '06 #27

P: n/a
Right. Some ISP's don't delegate reverse DNS.

If they do, zoneedit, and most other dynamic dns services
allow you to configure reverse dns.

I must admit, though, that I've never needed reverse dns services,
and all mail sent via my server's smtp service gets where it should go.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Gabriel Magaņa" <no*****@no-spam.com> wrote in message news:Op*************@TK2MSFTNGP12.phx.gbl...
That's why zoneedit.com and similar dynamic dns services are a life saver.


Yeh, but my point is that they do not do reverse-DNS lookups. For example, do a nslookup for
gmagana.dyndns.org. Then do an nslookup for the IP returned (the reverse-DNS lookup).... They
will not match. ISPs like AOL require these two to match.

Mar 3 '06 #28

P: n/a
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
As a matter of fact, I do have a domain name from dnsexit.com.
Not sure how to go about this.


If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
re:
So, it looks like that remote servers do not accept my mail.


If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab,both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
> re:
> >I am using .Net Framework 1.1
>
> Youi'll find sample code for changing the port number under system.web.amil here :
>
> http://systemwebmail.com/faq/2.9.aspx
>
> Essentially :
>
>
> MailMessage mail = new MailMessage();
> mail.To = "me@mycompany.com";
> mail.From = "yo*@yourcompany.com";
> mail.Subject = "this is a test email.";
> mail.Body = "Some text goes here";
> mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> number");
> SmtpMail.SmtpServer = "YourSmtpServer";
> SmtpMail.Send(mail);
>
> There's VB.NET sample code in the same page.
>
> Keep that systemwebmail link handy.
> All the info you need to solve web mail problems under .Net 1.1 is there.
>
> There's specific answers for both the "Could not access 'CDO.Message' object"
> and "The transport failed to connect to the server" exceptions which you reported.
>
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> Hi, Juan,
>
> Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> available with .Net framework 2.0
>
> I am using .Net Framework 1.1
>
> I know nothing about 2.0 at this point of time. Is there any way to go
> around this?
>
> Juan T. Llibre wrote:
> > re:
> > >Too bad that the .Net SmtpMail class does not let us set the port number.
> >
> > But it does allow you to do that :
> >
> > static void ChangePort()
> > {
> > //create the mail message
> > MailMessage mail = new MailMessage();
> >
> > //set the addresses
> > mail.From = new MailAddress("me@mycompany.com");
> > mail.To.Add("yo*@yourcompany.com");
> >
> > //set the content
> > mail.Subject = "This is an email";
> > mail.Body = "this is the body content of the email.";
> >
> > //send the message
> > SmtpClient smtp = new SmtpClient("127.0.0.1");
> >
> > //to change the port (default is 25), we set the port property
> > smtp.Port = 587;
> > smtp.Send(mail);
> > }
> >
> > Of course, for that to work you must set IIS's SMTP server
> > to the same port you set in your code. You can use any TCP port.
> >
> > To do that, view the Properties of the Default SMTP Server;
> > click the "Delivery" tab; click the "Outbound Connections" button;
> > and set the port number you want in the "Tcp port" box.
> >
> > That will get around your ISP's blockage of port 25.
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > Hi, Juan,
> >
> > Now I am having the typical "Could not access 'CDO.Message' object" and
> > "The transport failed to connect to the server" exceptions.
>
> ------=_NextPart_000_0047_01C63EC2.E70415E0
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 6344
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=#ffffff>
> <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> 1.1<BR><BR>Youi'll find sample code for changing the port number under
> system.web.amil here :<BR><BR></FONT><A
> href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
> title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
> face=Arial size=2>MailMessage mail = new MailMessage();
> mail.To = "me@mycompany.com";
> mail.From = "yo*@yourcompany.com";
> mail.Subject = "this is a test email.";
> mail.Body = "Some text goes here";
> mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> number");
> SmtpMail.SmtpServer = "YourSmtpServer";
> SmtpMail.Send(mail);
> </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> answers&nbsp;for both the "Could not access 'CDO.Message' object"
> <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> you reported.<BR></FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> <BR>===================================</FONT></DIV>
> <DIV><FONT face=Arial size=2>&lt;</FONT><A
> href="mailto:an***********@yahoo.com"><FONT face=Arial
> size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> message </FONT><A
> href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> face=Arial
> size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt;But it does
> allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; clickthe
> "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arialsize=2>&gt;
> asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> href="mailto:an***********@yahoo.com"><FONT face=Arial
> size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> message<BR>&gt; </FONT><A
> href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> face=Arial
> size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
> typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
>
> ------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 5 '06 #29

P: n/a
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
As a matter of fact, I do have a domain name from dnsexit.com.
Not sure how to go about this.


If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
re:
So, it looks like that remote servers do not accept my mail.


If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
Open the IIS Manager and check the properties for the smtp server.

In the Default SMTP Virtual Server's properties, in the "Access" tab, both
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )

You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )

Then, in your code, assign your machine name to the smtp client :

SmtpMail.SmtpServer = "YourMachineName";
SmtpMail.Send(mail);

This fixed the problem for me. I hope it does the same for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
It looks like that a lot of people have this problem, i.e., no
exception is thrown, but messages got packed up under
Inetpub/mailroot/Queue/ and never get sent. However, there does not
seem to have a solution so far. I googled around, only see people
asking for help, no one has really offered a solution to this problem.

At the following link, Leszek did say the problem was solved. But
she/he did not go into detail about her solution. E.g., How to set up
a real sender address on the SMTP virtual server? She/He did not
explain it.

Also, it looks like that she/he was using smarthost, which to my
understanding, is sending mail through a remote SMTP server provided by
some ISP. That would be a different story from what I am trying to
solve.

Here is that post:

http://groups.google.com/group/micro...75868e46c5729c

From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@5thbusiness.com>
Groups: microsoft.public.inetserver.iis

Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
> re:
> >I am using .Net Framework 1.1
>
> Youi'll find sample code for changing the port number under system.web.amil here :
>
> http://systemwebmail.com/faq/2.9.aspx
>
> Essentially :
>
>
> MailMessage mail = new MailMessage();
> mail.To = "me@mycompany.com";
> mail.From = "yo*@yourcompany.com";
> mail.Subject = "this is a test email.";
> mail.Body = "Some text goes here";
> mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> number");
> SmtpMail.SmtpServer = "YourSmtpServer";
> SmtpMail.Send(mail);
>
> There's VB.NET sample code in the same page.
>
> Keep that systemwebmail link handy.
> All the info you need to solve web mail problems under .Net 1.1 is there.
>
> There's specific answers for both the "Could not access 'CDO.Message' object"
> and "The transport failed to connect to the server" exceptions which you reported.
>
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> Hi, Juan,
>
> Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> available with .Net framework 2.0
>
> I am using .Net Framework 1.1
>
> I know nothing about 2.0 at this point of time. Is there any way to go
> around this?
>
> Juan T. Llibre wrote:
> > re:
> > >Too bad that the .Net SmtpMail class does not let us set the port number.
> >
> > But it does allow you to do that :
> >
> > static void ChangePort()
> > {
> > //create the mail message
> > MailMessage mail = new MailMessage();
> >
> > //set the addresses
> > mail.From = new MailAddress("me@mycompany.com");
> > mail.To.Add("yo*@yourcompany.com");
> >
> > //set the content
> > mail.Subject = "This is an email";
> > mail.Body = "this is the body content of the email.";
> >
> > //send the message
> > SmtpClient smtp = new SmtpClient("127.0.0.1");
> >
> > //to change the port (default is 25), we set the port property
> > smtp.Port = 587;
> > smtp.Send(mail);
> > }
> >
> > Of course, for that to work you must set IIS's SMTP server
> > to the same port you set in your code. You can use any TCP port.
> >
> > To do that, view the Properties of the Default SMTP Server;
> > click the "Delivery" tab; click the "Outbound Connections" button;
> > and set the port number you want in the "Tcp port" box.
> >
> > That will get around your ISP's blockage of port 25.
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > Hi, Juan,
> >
> > Now I am having the typical "Could not access 'CDO.Message' object" and
> > "The transport failed to connect to the server" exceptions.
>
> ------=_NextPart_000_0047_01C63EC2.E70415E0
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 6344
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=#ffffff>
> <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> 1.1<BR><BR>Youi'll find sample code for changing the port number under
> system.web.amil here :<BR><BR></FONT><A
> href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
> title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
> face=Arial size=2>MailMessage mail = new MailMessage();
> mail.To = "me@mycompany.com";
> mail.From = "yo*@yourcompany.com";
> mail.Subject = "this is a test email.";
> mail.Body = "Some text goes here";
> mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> number");
> SmtpMail.SmtpServer = "YourSmtpServer";
> SmtpMail.Send(mail);
> </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> answers&nbsp;for both the "Could not access 'CDO.Message' object"
> <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> you reported.<BR></FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> <BR>===================================</FONT></DIV>
> <DIV><FONT face=Arial size=2>&lt;</FONT><A
> href="mailto:an***********@yahoo.com"><FONT face=Arial
> size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> message </FONT><A
> href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> face=Arial
> size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
> "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> href="mailto:an***********@yahoo.com"><FONT face=Arial
> size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> message<BR>&gt; </FONT><A
> href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> face=Arial
> size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
> typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
>
> ------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 5 '06 #30

P: n/a
Hi, Juan,

I tried like you instructed, but I still cannot get it to work.

I also have

127.0.0.1 mydoman.com

in the hosts file under system32\drivers\etc\

In the code, I still have to say

SmtpMail.SmtpServer = "127.0.0.1"

If I don't, I get the typical "Cannot access CDO.Message" error.

The event viewer warning message still says that the destination domain
does not respond to a connection attempt from my smtp virtual server.

Juan T. Llibre wrote:
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
As a matter of fact, I do have a domain name from dnsexit.com.
Not sure how to go about this.


If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
re:
> So, it looks like that remote servers do not accept my mail.

If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename )sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
> Open the IIS Manager and check the properties for the smtp server.
>
> In the Default SMTP Virtual Server's properties, in the "Access" tab, both
> in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
> ( In my case, it's 10.0.0.2... )
>
> You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
> ( \WINDOWS\system32\drivers\etc\hosts )
>
> Then, in your code, assign your machine name to the smtp client :
>
> SmtpMail.SmtpServer = "YourMachineName";
> SmtpMail.Send(mail);
>
> This fixed the problem for me. I hope it does the same for you.
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> It looks like that a lot of people have this problem, i.e., no
> exception is thrown, but messages got packed up under
> Inetpub/mailroot/Queue/ and never get sent. However, there does not
> seem to have a solution so far. I googled around, only see people
> asking for help, no one has really offered a solution to this problem.
>
> At the following link, Leszek did say the problem was solved. But
> she/he did not go into detail about her solution. E.g., How to setup
> a real sender address on the SMTP virtual server? She/He did not
> explain it.
>
> Also, it looks like that she/he was using smarthost, which to my
> understanding, is sending mail through a remote SMTP server provided by
> some ISP. That would be a different story from what I am trying to
> solve.
>
> Here is that post:
>
> http://groups.google.com/group/micro...75868e46c5729c
>
> From: Leszek - view profile
> Date: Tues, Sep 9 2003 7:39 am
> Email: "Leszek" <tarat...@5thbusiness.com>
> Groups: microsoft.public.inetserver.iis
>
> Thank you very much.
> There were several problems with my IIS configuration (smart host, smtp
> server name etc). Moreover it turned out that I needed to set up a real
> sender address (From: field) to enforce the IIS to send emails. Strange
> but now it works perfectly.
>
>
> Juan T. Llibre wrote:
> > re:
> > >I am using .Net Framework 1.1
> >
> > Youi'll find sample code for changing the port number under system.web.amil here :
> >
> > http://systemwebmail.com/faq/2.9.aspx
> >
> > Essentially :
> >
> >
> > MailMessage mail = new MailMessage();
> > mail.To = "me@mycompany.com";
> > mail.From = "yo*@yourcompany.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> > number");
> > SmtpMail.SmtpServer = "YourSmtpServer";
> > SmtpMail.Send(mail);
> >
> > There's VB.NET sample code in the same page.
> >
> > Keep that systemwebmail link handy.
> > All the info you need to solve web mail problems under .Net 1.1 is there.
> >
> > There's specific answers for both the "Could not access 'CDO.Message' object"
> > and "The transport failed to connect to the server" exceptions which you reported.
> >
> >
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > Hi, Juan,
> >
> > Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> > available with .Net framework 2.0
> >
> > I am using .Net Framework 1.1
> >
> > I know nothing about 2.0 at this point of time. Is there any wayto go
> > around this?
> >
> > Juan T. Llibre wrote:
> > > re:
> > > >Too bad that the .Net SmtpMail class does not let us set the port number.
> > >
> > > But it does allow you to do that :
> > >
> > > static void ChangePort()
> > > {
> > > //create the mail message
> > > MailMessage mail = new MailMessage();
> > >
> > > //set the addresses
> > > mail.From = new MailAddress("me@mycompany.com");
> > > mail.To.Add("yo*@yourcompany.com");
> > >
> > > //set the content
> > > mail.Subject = "This is an email";
> > > mail.Body = "this is the body content of the email.";
> > >
> > > //send the message
> > > SmtpClient smtp = new SmtpClient("127.0.0.1");
> > >
> > > //to change the port (default is 25), we set the port property
> > > smtp.Port = 587;
> > > smtp.Send(mail);
> > > }
> > >
> > > Of course, for that to work you must set IIS's SMTP server
> > > to the same port you set in your code. You can use any TCP port.
> > >
> > > To do that, view the Properties of the Default SMTP Server;
> > > click the "Delivery" tab; click the "Outbound Connections" button;
> > > and set the port number you want in the "Tcp port" box.
> > >
> > > That will get around your ISP's blockage of port 25.
> > >
> > >
> > >
> > > Juan T. Llibre, asp.net MVP
> > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > asp.net faq : http://asp.net.do/faq/
> > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > ===================================
> > > <an***********@yahoo.com> wrote in message
> > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > Hi, Juan,
> > >
> > > Now I am having the typical "Could not access 'CDO.Message' object" and
> > > "The transport failed to connect to the server" exceptions.
> >
> > ------=_NextPart_000_0047_01C63EC2.E70415E0
> > Content-Type: text/html; charset=iso-8859-1
> > Content-Transfer-Encoding: quoted-printable
> > X-Google-AttachSize: 6344
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> > <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=#ffffff>
> > <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> > 1.1<BR><BR>Youi'll find sample code for changing the port number under
> > system.web.amil here :<BR><BR></FONT><A
> > href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> > size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> > size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';"
> > title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT
> > face=Arial size=2>MailMessage mail = new MailMessage();
> > mail.To = "me@mycompany.com";
> > mail.From = "yo*@yourcompany.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port
> > number");
> > SmtpMail.SmtpServer = "YourSmtpServer";
> > SmtpMail.Send(mail);
> > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> > solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> > answers&nbsp;for both the "Could not access 'CDO.Message' object"
> > <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> > you reported.<BR></FONT></DIV>
> > <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> > face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> > size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> > MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> > face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONTface=Arial
> > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> > asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> > size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> > <BR>===================================</FONT></DIV>
> > <DIV><FONT face=Arial size=2>&lt;</FONT><A
> > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > message </FONT><A
> > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > face=Arial
> > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> > SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> > face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> > 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> > this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> > SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> > allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> > {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> > MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> > MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> > size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> > mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> > size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> > //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> > "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> > message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> > //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> > = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> > work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> > code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> > of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
> > "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> > "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> > 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> > aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> > size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> > de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> > face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> > size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > message<BR>&gt; </FONT><A
> > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > face=Arial
> > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now Iam having the
> > typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> > failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
> >
> > ------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 5 '06 #31

P: n/a
Hi, Antony.

If what you are getting is a "Cannot access CDO.Message" error,
these FAQs have a few suggestions.

http://systemwebmail.com/faq/4.2.3.aspx

http://systemwebmail.com/faq/4.2.4.aspx

http://systemwebmail.com/faq/4.2.5.aspx

http://systemwebmail.com/faq/4.2.6.aspx

http://systemwebmail.com/faq/4.2.7.aspx

http://systemwebmail.com/faq/4.2.8.aspx

http://systemwebmail.com/faq/4.2.9.aspx

http://systemwebmail.com/faq/4.2.10.aspx

They are very specific to the "Cannot access CDO.Message" error.

Try them and let us know how you do.
One of them should turn the trick for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@v46g2000cwv.googlegrou ps.com...
Hi, Juan,

I tried like you instructed, but I still cannot get it to work.

I also have

127.0.0.1 mydoman.com

in the hosts file under system32\drivers\etc\

In the code, I still have to say

SmtpMail.SmtpServer = "127.0.0.1"

If I don't, I get the typical "Cannot access CDO.Message" error.

The event viewer warning message still says that the destination domain
does not respond to a connection attempt from my smtp virtual server.

Juan T. Llibre wrote:
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
As a matter of fact, I do have a domain name from dnsexit.com.
Not sure how to go about this.


If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
re:
> So, it looks like that remote servers do not accept my mail.

If you are using 127.0.0.1 as your smtp name,
mail servers will usually reject mail sent from it.

They will also reject mail originating at single-name ( machinename ) sources.

The best thing to do is register a domain name ( it's quite cheap )
and assign it to your fixed IP.

If you don't have a fixed IP, there's services like www.zoneedit.com
which can provide you with a free dns pointer to your domain,
even if you only have a dynamic IP address instead of a fixed IP.

Zoneedit will also give you a free domain MX, so that you can receive
mail addressed to mail.yourdomain.com or yourdomain.com.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.

I got a whole bunch of Warnings from source SMTPSVC like so:

Type Date Time Source Category Event User Computer
Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp

I right-clicked on one of them and viewed the properties. This is what
I saw:

Event Type: Warning
Event Source: smtpsvc
Event Category: None
Event ID: 4000
Date: 3/3/2006
Time: 3:02:13 PM
User: N/A
Computer: JZGWXP

Description:
Message delivery to the remote domain 'gmail.com' failed for the
following reason: The remote server did not respond to a connection
attempt.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: d2 02 04 c0 Ō..Ā

So, it looks like that remote servers do not accept my mail.
Juan T. Llibre wrote:
> Open the IIS Manager and check the properties for the smtp server.
>
> In the Default SMTP Virtual Server's properties, in the "Access" tab, both
> in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
> ( In my case, it's 10.0.0.2... )
>
> You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
> ( \WINDOWS\system32\drivers\etc\hosts )
>
> Then, in your code, assign your machine name to the smtp client :
>
> SmtpMail.SmtpServer = "YourMachineName";
> SmtpMail.Send(mail);
>
> This fixed the problem for me. I hope it does the same for you.
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@i39g2000cwa.googlegr oups.com...
> It looks like that a lot of people have this problem, i.e., no
> exception is thrown, but messages got packed up under
> Inetpub/mailroot/Queue/ and never get sent. However, there does not
> seem to have a solution so far. I googled around, only see people
> asking for help, no one has really offered a solution to this problem.
>
> At the following link, Leszek did say the problem was solved. But
> she/he did not go into detail about her solution. E.g., How to set up
> a real sender address on the SMTP virtual server? She/He did not
> explain it.
>
> Also, it looks like that she/he was using smarthost, which to my
> understanding, is sending mail through a remote SMTP server provided by
> some ISP. That would be a different story from what I am trying to
> solve.
>
> Here is that post:
>
> http://groups.google.com/group/micro...75868e46c5729c
>
> From: Leszek - view profile
> Date: Tues, Sep 9 2003 7:39 am
> Email: "Leszek" <tarat...@5thbusiness.com>
> Groups: microsoft.public.inetserver.iis
>
> Thank you very much.
> There were several problems with my IIS configuration (smart host, smtp
> server name etc). Moreover it turned out that I needed to set up a real
> sender address (From: field) to enforce the IIS to send emails. Strange
> but now it works perfectly.
>
>
> Juan T. Llibre wrote:
> > re:
> > >I am using .Net Framework 1.1
> >
> > Youi'll find sample code for changing the port number under system.web.amil here :
> >
> > http://systemwebmail.com/faq/2.9.aspx
> >
> > Essentially :
> >
> >
> > MailMessage mail = new MailMessage();
> > mail.To = "me@mycompany.com";
> > mail.From = "yo*@yourcompany.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > port
> > number");
> > SmtpMail.SmtpServer = "YourSmtpServer";
> > SmtpMail.Send(mail);
> >
> > There's VB.NET sample code in the same page.
> >
> > Keep that systemwebmail link handy.
> > All the info you need to solve web mail problems under .Net 1.1 is there.
> >
> > There's specific answers for both the "Could not access 'CDO.Message' object"
> > and "The transport failed to connect to the server" exceptions which you reported.
> >
> >
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > Hi, Juan,
> >
> > Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> > available with .Net framework 2.0
> >
> > I am using .Net Framework 1.1
> >
> > I know nothing about 2.0 at this point of time. Is there any way to go
> > around this?
> >
> > Juan T. Llibre wrote:
> > > re:
> > > >Too bad that the .Net SmtpMail class does not let us set the port number.
> > >
> > > But it does allow you to do that :
> > >
> > > static void ChangePort()
> > > {
> > > //create the mail message
> > > MailMessage mail = new MailMessage();
> > >
> > > //set the addresses
> > > mail.From = new MailAddress("me@mycompany.com");
> > > mail.To.Add("yo*@yourcompany.com");
> > >
> > > //set the content
> > > mail.Subject = "This is an email";
> > > mail.Body = "this is the body content of the email.";
> > >
> > > //send the message
> > > SmtpClient smtp = new SmtpClient("127.0.0.1");
> > >
> > > //to change the port (default is 25), we set the port property
> > > smtp.Port = 587;
> > > smtp.Send(mail);
> > > }
> > >
> > > Of course, for that to work you must set IIS's SMTP server
> > > to the same port you set in your code. You can use any TCP port.
> > >
> > > To do that, view the Properties of the Default SMTP Server;
> > > click the "Delivery" tab; click the "Outbound Connections" button;
> > > and set the port number you want in the "Tcp port" box.
> > >
> > > That will get around your ISP's blockage of port 25.
> > >
> > >
> > >
> > > Juan T. Llibre, asp.net MVP
> > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > asp.net faq : http://asp.net.do/faq/
> > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > ===================================
> > > <an***********@yahoo.com> wrote in message
> > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > Hi, Juan,
> > >
> > > Now I am having the typical "Could not access 'CDO.Message' object" and
> > > "The transport failed to connect to the server" exceptions.
> >
> > ------=_NextPart_000_0047_01C63EC2.E70415E0
> > Content-Type: text/html; charset=iso-8859-1
> > Content-Transfer-Encoding: quoted-printable
> > X-Google-AttachSize: 6344
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> > <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=#ffffff>
> > <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> > 1.1<BR><BR>Youi'll find sample code for changing the port number under
> > system.web.amil here :<BR><BR></FONT><A
> > href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> > size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> > size=2>Essentially :<BR><BR></FONT><PRE class=csharp
> > onmouseover="this.style.cursor='hand';"
> > title="Click to copy to clipboard" style="CURSOR: hand"
> > onclick=copyToClipboard(this);><FONT
> > face=Arial size=2>MailMessage mail = new MailMessage();
> > mail.To = "me@mycompany.com";
> > mail.From = "yo*@yourcompany.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > port
> > number");
> > SmtpMail.SmtpServer = "YourSmtpServer";
> > SmtpMail.Send(mail);
> > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> > solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> > answers&nbsp;for both the "Could not access 'CDO.Message' object"
> > <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> > you reported.<BR></FONT></DIV>
> > <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> > face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> > size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> > MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> > face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> > asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> > size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> > <BR>===================================</FONT></DIV>
> > <DIV><FONT face=Arial size=2>&lt;</FONT><A
> > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > message </FONT><A
> > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > face=Arial
> > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> > SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> > face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> > 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> > this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> > SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> > allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> > {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> > MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> > MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> > size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> > mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> > size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> > //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> > "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> > message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> > //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> > = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> > work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> > code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> > of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
> > "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> > "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> > 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> > aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> > size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> > de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> > face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> > size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > message<BR>&gt; </FONT><A
> > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > face=Arial
> > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
> > typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> > failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
> >
> > ------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 5 '06 #32

P: n/a
Hi, Juan,

Thanks, but I think those are way too complicated.
Juan T. Llibre wrote:
Hi, Antony.

If what you are getting is a "Cannot access CDO.Message" error,
these FAQs have a few suggestions.

http://systemwebmail.com/faq/4.2.3.aspx

http://systemwebmail.com/faq/4.2.4.aspx

http://systemwebmail.com/faq/4.2.5.aspx

http://systemwebmail.com/faq/4.2.6.aspx

http://systemwebmail.com/faq/4.2.7.aspx

http://systemwebmail.com/faq/4.2.8.aspx

http://systemwebmail.com/faq/4.2.9.aspx

http://systemwebmail.com/faq/4.2.10.aspx

They are very specific to the "Cannot access CDO.Message" error.

Try them and let us know how you do.
One of them should turn the trick for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@v46g2000cwv.googlegrou ps.com...
Hi, Juan,

I tried like you instructed, but I still cannot get it to work.

I also have

127.0.0.1 mydoman.com

in the hosts file under system32\drivers\etc\

In the code, I still have to say

SmtpMail.SmtpServer = "127.0.0.1"

If I don't, I get the typical "Cannot access CDO.Message" error.

The event viewer warning message still says that the destination domain
does not respond to a connection attempt from my smtp virtual server.

Juan T. Llibre wrote:
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
>As a matter of fact, I do have a domain name from dnsexit.com.
>Not sure how to go about this.

If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
> re:
> > So, it looks like that remote servers do not accept my mail.
>
> If you are using 127.0.0.1 as your smtp name,
> mail servers will usually reject mail sent from it.
>
> They will also reject mail originating at single-name ( machinename) sources.
>
> The best thing to do is register a domain name ( it's quite cheap )
> and assign it to your fixed IP.
>
> If you don't have a fixed IP, there's services like www.zoneedit.com
> which can provide you with a free dns pointer to your domain,
> even if you only have a dynamic IP address instead of a fixed IP.
>
> Zoneedit will also give you a free domain MX, so that you can receive
> mail addressed to mail.yourdomain.com or yourdomain.com.
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@v46g2000cwv.googlegr oups.com...
> As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.
>
> I got a whole bunch of Warnings from source SMTPSVC like so:
>
> Type Date Time Source Category Event User Computer
> Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp
>
> I right-clicked on one of them and viewed the properties. This is what
> I saw:
>
> Event Type: Warning
> Event Source: smtpsvc
> Event Category: None
> Event ID: 4000
> Date: 3/3/2006
> Time: 3:02:13 PM
> User: N/A
> Computer: JZGWXP
>
> Description:
> Message delivery to the remote domain 'gmail.com' failed for the
> following reason: The remote server did not respond to a connection
> attempt.
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
> Data:
> 0000: d2 02 04 c0 Ō..Ā
>
> So, it looks like that remote servers do not accept my mail.
>
>
> Juan T. Llibre wrote:
> > Open the IIS Manager and check the properties for the smtp server.
> >
> > In the Default SMTP Virtual Server's properties, in the "Access" tab, both
> > in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
> > ( In my case, it's 10.0.0.2... )
> >
> > You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
> > ( \WINDOWS\system32\drivers\etc\hosts )
> >
> > Then, in your code, assign your machine name to the smtp client :
> >
> > SmtpMail.SmtpServer = "YourMachineName";
> > SmtpMail.Send(mail);
> >
> > This fixed the problem for me. I hope it does the same for you.
> >
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > It looks like that a lot of people have this problem, i.e., no
> > exception is thrown, but messages got packed up under
> > Inetpub/mailroot/Queue/ and never get sent. However, there does not
> > seem to have a solution so far. I googled around, only see people
> > asking for help, no one has really offered a solution to this problem.
> >
> > At the following link, Leszek did say the problem was solved. But
> > she/he did not go into detail about her solution. E.g., How to set up
> > a real sender address on the SMTP virtual server? She/He did not
> > explain it.
> >
> > Also, it looks like that she/he was using smarthost, which to my
> > understanding, is sending mail through a remote SMTP server provided by
> > some ISP. That would be a different story from what I am trying to
> > solve.
> >
> > Here is that post:
> >
> > http://groups.google.com/group/micro...75868e46c5729c
> >
> > From: Leszek - view profile
> > Date: Tues, Sep 9 2003 7:39 am
> > Email: "Leszek" <tarat...@5thbusiness.com>
> > Groups: microsoft.public.inetserver.iis
> >
> > Thank you very much.
> > There were several problems with my IIS configuration (smart host, smtp
> > server name etc). Moreover it turned out that I needed to set up a real
> > sender address (From: field) to enforce the IIS to send emails. Strange
> > but now it works perfectly.
> >
> >
> > Juan T. Llibre wrote:
> > > re:
> > > >I am using .Net Framework 1.1
> > >
> > > Youi'll find sample code for changing the port number under system.web.amil here :
> > >
> > > http://systemwebmail.com/faq/2.9.aspx
> > >
> > > Essentially :
> > >
> > >
> > > MailMessage mail = new MailMessage();
> > > mail.To = "me@mycompany.com";
> > > mail.From = "yo*@yourcompany.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > port
> > > number");
> > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > SmtpMail.Send(mail);
> > >
> > > There's VB.NET sample code in the same page.
> > >
> > > Keep that systemwebmail link handy.
> > > All the info you need to solve web mail problems under .Net 1.1is there.
> > >
> > > There's specific answers for both the "Could not access 'CDO.Message' object"
> > > and "The transport failed to connect to the server" exceptions which you reported.
> > >
> > >
> > >
> > >
> > >
> > > Juan T. Llibre, asp.net MVP
> > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > asp.net faq : http://asp.net.do/faq/
> > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > ===================================
> > > <an***********@yahoo.com> wrote in message
> > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > Hi, Juan,
> > >
> > > Thanks a lot. Unfortunately, it looks like that the SmtpClientis only
> > > available with .Net framework 2.0
> > >
> > > I am using .Net Framework 1.1
> > >
> > > I know nothing about 2.0 at this point of time. Is there any way to go
> > > around this?
> > >
> > > Juan T. Llibre wrote:
> > > > re:
> > > > >Too bad that the .Net SmtpMail class does not let us set theport number.
> > > >
> > > > But it does allow you to do that :
> > > >
> > > > static void ChangePort()
> > > > {
> > > > //create the mail message
> > > > MailMessage mail = new MailMessage();
> > > >
> > > > //set the addresses
> > > > mail.From = new MailAddress("me@mycompany.com");
> > > > mail.To.Add("yo*@yourcompany.com");
> > > >
> > > > //set the content
> > > > mail.Subject = "This is an email";
> > > > mail.Body = "this is the body content of the email.";
> > > >
> > > > //send the message
> > > > SmtpClient smtp = new SmtpClient("127.0.0.1");
> > > >
> > > > //to change the port (default is 25), we set the port property
> > > > smtp.Port = 587;
> > > > smtp.Send(mail);
> > > > }
> > > >
> > > > Of course, for that to work you must set IIS's SMTP server
> > > > to the same port you set in your code. You can use any TCP port.
> > > >
> > > > To do that, view the Properties of the Default SMTP Server;
> > > > click the "Delivery" tab; click the "Outbound Connections" button;
> > > > and set the port number you want in the "Tcp port" box.
> > > >
> > > > That will get around your ISP's blockage of port 25.
> > > >
> > > >
> > > >
> > > > Juan T. Llibre, asp.net MVP
> > > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > > asp.net faq : http://asp.net.do/faq/
> > > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > > ===================================
> > > > <an***********@yahoo.com> wrote in message
> > > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > > Hi, Juan,
> > > >
> > > > Now I am having the typical "Could not access 'CDO.Message' object" and
> > > > "The transport failed to connect to the server" exceptions.
> > >
> > > ------=_NextPart_000_0047_01C63EC2.E70415E0
> > > Content-Type: text/html; charset=iso-8859-1
> > > Content-Transfer-Encoding: quoted-printable
> > > X-Google-AttachSize: 6344
> > >
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <HTML><HEAD>
> > > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> > > <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> > > <STYLE></STYLE>
> > > </HEAD>
> > > <BODY bgColor=#ffffff>
> > > <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> > > 1.1<BR><BR>Youi'll find sample code for changing the port number under
> > > system.web.amil here :<BR><BR></FONT><A
> > > href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> > > size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> > > size=2>Essentially :<BR><BR></FONT><PRE class=csharp
> > > onmouseover="this.style.cursor='hand';"
> > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > onclick=copyToClipboard(this);><FONT
> > > face=Arial size=2>MailMessage mail = new MailMessage();
> > > mail.To = "me@mycompany.com";
> > > mail.From = "yo*@yourcompany.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > port
> > > number");
> > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > SmtpMail.Send(mail);
> > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> > > solve web mail problems under .Net 1.1 is there.<BR><BR>There'sspecific
> > > answers&nbsp;for both the "Could not access 'CDO.Message' object"
> > > <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> > > you reported.<BR></FONT></DIV>
> > > <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> > > face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> > > size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> > > MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> > > face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONTface=Arial size=2>
> > > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> > > asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> > > size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> > > <BR>===================================</FONT></DIV>
> > > <DIV><FONT face=Arial size=2>&lt;</FONT><A
> > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > > message </FONT><A
> > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > face=Arial
> > > size=2>news:11**********************@i39g2000cwa.g ooglegroups..com</FONT></A><FONT
> > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> > > SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> > > face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> > > 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> > > this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> > > SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> > > allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> > > {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> > > MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail..From = new
> > > MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> > > size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> > > mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> > > size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> > > //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> > > "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> > > message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> > > //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> > > = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> > > work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> > > code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> > > of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
> > > "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> > > "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP'sblockage of port
> > > 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> > > aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> > > size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> > > de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> > > face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> > > size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > > message<BR>&gt; </FONT><A
> > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > face=Arial
> > > size=2>news:11**********************@i39g2000cwa.g ooglegroups..com</FONT></A><FONT
> > > face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; NowI am having the
> > > typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> > > failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
> > >
> > > ------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 5 '06 #33

P: n/a
In that case, you shouldn't be fiddling with this.
Stay with the easy stuff, although you'll never amount to anything that way.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<zh****@gmail.com> wrote in message news:11**********************@v46g2000cwv.googlegr oups.com...
Hi, Juan,

Thanks, but I think those are way too complicated.
Juan T. Llibre wrote:
Hi, Antony.

If what you are getting is a "Cannot access CDO.Message" error,
these FAQs have a few suggestions.

http://systemwebmail.com/faq/4.2.3.aspx

http://systemwebmail.com/faq/4.2.4.aspx

http://systemwebmail.com/faq/4.2.5.aspx

http://systemwebmail.com/faq/4.2.6.aspx

http://systemwebmail.com/faq/4.2.7.aspx

http://systemwebmail.com/faq/4.2.8.aspx

http://systemwebmail.com/faq/4.2.9.aspx

http://systemwebmail.com/faq/4.2.10.aspx

They are very specific to the "Cannot access CDO.Message" error.

Try them and let us know how you do.
One of them should turn the trick for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@v46g2000cwv.googlegrou ps.com...
Hi, Juan,

I tried like you instructed, but I still cannot get it to work.

I also have

127.0.0.1 mydoman.com

in the hosts file under system32\drivers\etc\

In the code, I still have to say

SmtpMail.SmtpServer = "127.0.0.1"

If I don't, I get the typical "Cannot access CDO.Message" error.

The event viewer warning message still says that the destination domain
does not respond to a connection attempt from my smtp virtual server.

Juan T. Llibre wrote:
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
re:
>As a matter of fact, I do have a domain name from dnsexit.com.
>Not sure how to go about this.

If you have a domain name, you should setup a virtual domain
for the smtp server, and use your domain name as an alias.

You can also, as suggested before, create a virtual domain for your
machinename and map 127.0.0.1, in the hosts file, to your machinename.

For example, I have an smtp virtual domain for asp.net.do
and another virtual domain for my machine's name, and both work fine.

Use the IIS Manager to create your virtual domains for your smtp server.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi, Juan,

As a matter of fact, I do have a domain name from dnsexit.com.

I tried allowing relay for my own IP, the dynamic one (which changes
once every long while) assigned by my ISP.

And then I would use

SmtpMail.SmtpServer = "70.225.171.219"

But then, I would get the typical "Could not access 'CDO.Message'
object" exception. It looks like that I won't get this exception only
if I use "127.0.0.1".

Not sure how to go about this. It's getting really really frustrating.
Juan T. Llibre wrote:
> re:
> > So, it looks like that remote servers do not accept my mail.
>
> If you are using 127.0.0.1 as your smtp name,
> mail servers will usually reject mail sent from it.
>
> They will also reject mail originating at single-name ( machinename ) sources.
>
> The best thing to do is register a domain name ( it's quite cheap )
> and assign it to your fixed IP.
>
> If you don't have a fixed IP, there's services like www.zoneedit.com
> which can provide you with a free dns pointer to your domain,
> even if you only have a dynamic IP address instead of a fixed IP.
>
> Zoneedit will also give you a free domain MX, so that you can receive
> mail addressed to mail.yourdomain.com or yourdomain.com.
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@v46g2000cwv.googlegr oups.com...
> As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.
>
> I got a whole bunch of Warnings from source SMTPSVC like so:
>
> Type Date Time Source Category Event User Computer
> Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
> Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp
>
> I right-clicked on one of them and viewed the properties. This is what
> I saw:
>
> Event Type: Warning
> Event Source: smtpsvc
> Event Category: None
> Event ID: 4000
> Date: 3/3/2006
> Time: 3:02:13 PM
> User: N/A
> Computer: JZGWXP
>
> Description:
> Message delivery to the remote domain 'gmail.com' failed for the
> following reason: The remote server did not respond to a connection
> attempt.
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
> Data:
> 0000: d2 02 04 c0 Ō..Ā
>
> So, it looks like that remote servers do not accept my mail.
>
>
> Juan T. Llibre wrote:
> > Open the IIS Manager and check the properties for the smtp server.
> >
> > In the Default SMTP Virtual Server's properties, in the "Access" tab, both
> > in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
> > ( In my case, it's 10.0.0.2... )
> >
> > You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
> > ( \WINDOWS\system32\drivers\etc\hosts )
> >
> > Then, in your code, assign your machine name to the smtp client :
> >
> > SmtpMail.SmtpServer = "YourMachineName";
> > SmtpMail.Send(mail);
> >
> > This fixed the problem for me. I hope it does the same for you.
> >
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@i39g2000cwa.googlegr oups.com...
> > It looks like that a lot of people have this problem, i.e., no
> > exception is thrown, but messages got packed up under
> > Inetpub/mailroot/Queue/ and never get sent. However, there does not
> > seem to have a solution so far. I googled around, only see people
> > asking for help, no one has really offered a solution to this problem.
> >
> > At the following link, Leszek did say the problem was solved. But
> > she/he did not go into detail about her solution. E.g., How to set up
> > a real sender address on the SMTP virtual server? She/He did not
> > explain it.
> >
> > Also, it looks like that she/he was using smarthost, which to my
> > understanding, is sending mail through a remote SMTP server provided by
> > some ISP. That would be a different story from what I am trying to
> > solve.
> >
> > Here is that post:
> >
> > http://groups.google.com/group/micro...75868e46c5729c
> >
> > From: Leszek - view profile
> > Date: Tues, Sep 9 2003 7:39 am
> > Email: "Leszek" <tarat...@5thbusiness.com>
> > Groups: microsoft.public.inetserver.iis
> >
> > Thank you very much.
> > There were several problems with my IIS configuration (smart host, smtp
> > server name etc). Moreover it turned out that I needed to set up a real
> > sender address (From: field) to enforce the IIS to send emails. Strange
> > but now it works perfectly.
> >
> >
> > Juan T. Llibre wrote:
> > > re:
> > > >I am using .Net Framework 1.1
> > >
> > > Youi'll find sample code for changing the port number under system.web.amil here :
> > >
> > > http://systemwebmail.com/faq/2.9.aspx
> > >
> > > Essentially :
> > >
> > >
> > > MailMessage mail = new MailMessage();
> > > mail.To = "me@mycompany.com";
> > > mail.From = "yo*@yourcompany.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > port
> > > number");
> > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > SmtpMail.Send(mail);
> > >
> > > There's VB.NET sample code in the same page.
> > >
> > > Keep that systemwebmail link handy.
> > > All the info you need to solve web mail problems under .Net 1.1 is there.
> > >
> > > There's specific answers for both the "Could not access 'CDO.Message' object"
> > > and "The transport failed to connect to the server" exceptions which you reported.
> > >
> > >
> > >
> > >
> > >
> > > Juan T. Llibre, asp.net MVP
> > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > asp.net faq : http://asp.net.do/faq/
> > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > ===================================
> > > <an***********@yahoo.com> wrote in message
> > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > Hi, Juan,
> > >
> > > Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> > > available with .Net framework 2.0
> > >
> > > I am using .Net Framework 1.1
> > >
> > > I know nothing about 2.0 at this point of time. Is there any way to go
> > > around this?
> > >
> > > Juan T. Llibre wrote:
> > > > re:
> > > > >Too bad that the .Net SmtpMail class does not let us set the port number.
> > > >
> > > > But it does allow you to do that :
> > > >
> > > > static void ChangePort()
> > > > {
> > > > //create the mail message
> > > > MailMessage mail = new MailMessage();
> > > >
> > > > //set the addresses
> > > > mail.From = new MailAddress("me@mycompany.com");
> > > > mail.To.Add("yo*@yourcompany.com");
> > > >
> > > > //set the content
> > > > mail.Subject = "This is an email";
> > > > mail.Body = "this is the body content of the email.";
> > > >
> > > > //send the message
> > > > SmtpClient smtp = new SmtpClient("127.0.0.1");
> > > >
> > > > //to change the port (default is 25), we set the port property
> > > > smtp.Port = 587;
> > > > smtp.Send(mail);
> > > > }
> > > >
> > > > Of course, for that to work you must set IIS's SMTP server
> > > > to the same port you set in your code. You can use any TCP port.
> > > >
> > > > To do that, view the Properties of the Default SMTP Server;
> > > > click the "Delivery" tab; click the "Outbound Connections" button;
> > > > and set the port number you want in the "Tcp port" box.
> > > >
> > > > That will get around your ISP's blockage of port 25.
> > > >
> > > >
> > > >
> > > > Juan T. Llibre, asp.net MVP
> > > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > > asp.net faq : http://asp.net.do/faq/
> > > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > > ===================================
> > > > <an***********@yahoo.com> wrote in message
> > > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > > Hi, Juan,
> > > >
> > > > Now I am having the typical "Could not access 'CDO.Message' object" and
> > > > "The transport failed to connect to the server" exceptions.
> > >
> > > ------=_NextPart_000_0047_01C63EC2.E70415E0
> > > Content-Type: text/html; charset=iso-8859-1
> > > Content-Transfer-Encoding: quoted-printable
> > > X-Google-AttachSize: 6344
> > >
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <HTML><HEAD>
> > > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> > > <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> > > <STYLE></STYLE>
> > > </HEAD>
> > > <BODY bgColor=#ffffff>
> > > <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> > > 1.1<BR><BR>Youi'll find sample code for changing the port number under
> > > system.web.amil here :<BR><BR></FONT><A
> > > href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> > > size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> > > size=2>Essentially :<BR><BR></FONT><PRE class=csharp
> > > onmouseover="this.style.cursor='hand';"
> > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > onclick=copyToClipboard(this);><FONT
> > > face=Arial size=2>MailMessage mail = new MailMessage();
> > > mail.To = "me@mycompany.com";
> > > mail.From = "yo*@yourcompany.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > port
> > > number");
> > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > SmtpMail.Send(mail);
> > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> > > solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> > > answers&nbsp;for both the "Could not access 'CDO.Message' object"
> > > <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> > > you reported.<BR></FONT></DIV>
> > > <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> > > face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> > > size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> > > MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
> > > face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> > > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> > > asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> > > size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> > > <BR>===================================</FONT></DIV>
> > > <DIV><FONT face=Arial size=2>&lt;</FONT><A
> > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > > message </FONT><A
> > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > face=Arial
> > > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks like that the
> > > SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> > > face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> > > 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> > > this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> > > SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> > > allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> > > {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> > > MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> > > MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONT face=Arial
> > > size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> > > mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> > > size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> > > //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> > > "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> > > message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> > > //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> > > = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> > > work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> > > code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> > > of the Default SMTP Server;<BR>&gt; click the "Delivery" tab; click the
> > > "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> > > "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> > > 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> > > aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> > > size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> > > de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> > > face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> > > size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arial size=2>&gt; wrote in
> > > message<BR>&gt; </FONT><A
> > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > face=Arial
> > > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > > face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
> > > typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> > > failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
> > >
> > > ------=_NextPart_000_0047_01C63EC2.E70415E0--

Mar 5 '06 #34

P: n/a
Hey, Juan,

As a matter of fact, I am still curious about it. But I am only doing
this for fun.

However, I have a few school projects due pretty soon, so I will have
to continue with the annoying SMTP virtual server thing some time
later.

Cheers.

Juan T. Llibre wrote:
In that case, you shouldn't be fiddling with this.
Stay with the easy stuff, although you'll never amount to anything that way.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<zh****@gmail.com> wrote in message news:11**********************@v46g2000cwv.googlegr oups.com...
Hi, Juan,

Thanks, but I think those are way too complicated.
Juan T. Llibre wrote:
Hi, Antony.

If what you are getting is a "Cannot access CDO.Message" error,
these FAQs have a few suggestions.

http://systemwebmail.com/faq/4.2.3.aspx

http://systemwebmail.com/faq/4.2.4.aspx

http://systemwebmail.com/faq/4.2.5.aspx

http://systemwebmail.com/faq/4.2.6.aspx

http://systemwebmail.com/faq/4.2.7.aspx

http://systemwebmail.com/faq/4.2.8.aspx

http://systemwebmail.com/faq/4.2.9.aspx

http://systemwebmail.com/faq/4.2.10.aspx

They are very specific to the "Cannot access CDO.Message" error.

Try them and let us know how you do.
One of them should turn the trick for you.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11********************@v46g2000cwv.googlegrou ps.com...
Hi, Juan,

I tried like you instructed, but I still cannot get it to work.

I also have

127.0.0.1 mydoman.com

in the hosts file under system32\drivers\etc\

In the code, I still have to say

SmtpMail.SmtpServer = "127.0.0.1"

If I don't, I get the typical "Cannot access CDO.Message" error.

The event viewer warning message still says that the destination domain
does not respond to a connection attempt from my smtp virtual server.

Juan T. Llibre wrote:
It's real simple.

Open the IIS Manager; scroll down to "Default SMTP Server";
click the "+" sign; select "Domains"; right-click "Domains"
and select "New" and then "Domain".

Select "alias", click "Next" and then write in
your domain name in the next dialog.

That's it!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<an***********@yahoo.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hmm, but I really don't know how to setup a virtual domain for my smtp
server. I googled, but could not a good tutorial.

Juan T. Llibre wrote:
> re:
> >As a matter of fact, I do have a domain name from dnsexit.com.
> >Not sure how to go about this.
>
> If you have a domain name, you should setup a virtual domain
> for the smtp server, and use your domain name as an alias.
>
> You can also, as suggested before, create a virtual domain for your
> machinename and map 127.0.0.1, in the hosts file, to your machinename.
>
> For example, I have an smtp virtual domain for asp.net.do
> and another virtual domain for my machine's name, and both work fine.
>
> Use the IIS Manager to create your virtual domains for your smtp server.
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> <an***********@yahoo.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.com...
> Hi, Juan,
>
> As a matter of fact, I do have a domain name from dnsexit.com.
>
> I tried allowing relay for my own IP, the dynamic one (which changes
> once every long while) assigned by my ISP.
>
> And then I would use
>
> SmtpMail.SmtpServer = "70.225.171.219"
>
> But then, I would get the typical "Could not access 'CDO.Message'
> object" exception. It looks like that I won't get this exception only
> if I use "127.0.0.1".
>
> Not sure how to go about this. It's getting really really frustrating.
>
>
> Juan T. Llibre wrote:
> > re:
> > > So, it looks like that remote servers do not accept my mail.
> >
> > If you are using 127.0.0.1 as your smtp name,
> > mail servers will usually reject mail sent from it.
> >
> > They will also reject mail originating at single-name ( machinename ) sources.
> >
> > The best thing to do is register a domain name ( it's quite cheap)
> > and assign it to your fixed IP.
> >
> > If you don't have a fixed IP, there's services like www.zoneedit.com
> > which can provide you with a free dns pointer to your domain,
> > even if you only have a dynamic IP address instead of a fixed IP.
> >
> > Zoneedit will also give you a free domain MX, so that you can receive
> > mail addressed to mail.yourdomain.com or yourdomain.com.
> >
> >
> >
> > Juan T. Llibre, asp.net MVP
> > aspnetfaq.com : http://www.aspnetfaq.com/
> > asp.net faq : http://asp.net.do/faq/
> > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > ===================================
> > <an***********@yahoo.com> wrote in message
> > news:11**********************@v46g2000cwv.googlegr oups.com...
> > As a follow-up, I did Start>Run>eventvwr.msc, and clicked System.
> >
> > I got a whole bunch of Warnings from source SMTPSVC like so:
> >
> > Type Date Time Source Category Event User Computer
> > Warning 3/3/2006 3:02:13PM SMTPSVC None 4000 N/A jzgwxp
> > Warning 3/3/2006 1:40:23PM SMTPSVC None 4000 N/A jzgwxp
> > Warning 3/3/2006 1:25:51PM SMTPSVC None 4000 N/A jzgwxp
> > Warning 3/3/2006 1:12:17PM SMTPSVC None 4000 N/A jzgwxp
> >
> > I right-clicked on one of them and viewed the properties. This is what
> > I saw:
> >
> > Event Type: Warning
> > Event Source: smtpsvc
> > Event Category: None
> > Event ID: 4000
> > Date: 3/3/2006
> > Time: 3:02:13 PM
> > User: N/A
> > Computer: JZGWXP
> >
> > Description:
> > Message delivery to the remote domain 'gmail.com' failed for the
> > following reason: The remote server did not respond to a connection
> > attempt.
> >
> > For more information, see Help and Support Center at
> > http://go.microsoft.com/fwlink/events.asp.
> > Data:
> > 0000: d2 02 04 c0 Ō..Ā
> >
> > So, it looks like that remote servers do not accept my mail.
> >
> >
> > Juan T. Llibre wrote:
> > > Open the IIS Manager and check the properties for the smtp server.
> > >
> > > In the Default SMTP Virtual Server's properties, in the "Access" tab, both
> > > in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
> > > ( In my case, it's 10.0.0.2... )
> > >
> > > You may also need to modify your hosts file, to point 127.0.0.1to your machine name.
> > > ( \WINDOWS\system32\drivers\etc\hosts )
> > >
> > > Then, in your code, assign your machine name to the smtp client:
> > >
> > > SmtpMail.SmtpServer = "YourMachineName";
> > > SmtpMail.Send(mail);
> > >
> > > This fixed the problem for me. I hope it does the same for you.
> > >
> > >
> > >
> > >
> > > Juan T. Llibre, asp.net MVP
> > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > asp.net faq : http://asp.net.do/faq/
> > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > ===================================
> > > <an***********@yahoo.com> wrote in message
> > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > It looks like that a lot of people have this problem, i.e., no
> > > exception is thrown, but messages got packed up under
> > > Inetpub/mailroot/Queue/ and never get sent. However, there does not
> > > seem to have a solution so far. I googled around, only see people
> > > asking for help, no one has really offered a solution to this problem.
> > >
> > > At the following link, Leszek did say the problem was solved. But
> > > she/he did not go into detail about her solution. E.g., How toset up
> > > a real sender address on the SMTP virtual server? She/He did not
> > > explain it.
> > >
> > > Also, it looks like that she/he was using smarthost, which to my
> > > understanding, is sending mail through a remote SMTP server provided by
> > > some ISP. That would be a different story from what I am trying to
> > > solve.
> > >
> > > Here is that post:
> > >
> > > http://groups.google.com/group/micro...75868e46c5729c
> > >
> > > From: Leszek - view profile
> > > Date: Tues, Sep 9 2003 7:39 am
> > > Email: "Leszek" <tarat...@5thbusiness.com>
> > > Groups: microsoft.public.inetserver.iis
> > >
> > > Thank you very much.
> > > There were several problems with my IIS configuration (smart host, smtp
> > > server name etc). Moreover it turned out that I needed to set up a real
> > > sender address (From: field) to enforce the IIS to send emails.Strange
> > > but now it works perfectly.
> > >
> > >
> > > Juan T. Llibre wrote:
> > > > re:
> > > > >I am using .Net Framework 1.1
> > > >
> > > > Youi'll find sample code for changing the port number under system.web.amil here :
> > > >
> > > > http://systemwebmail.com/faq/2.9.aspx
> > > >
> > > > Essentially :
> > > >
> > > >
> > > > MailMessage mail = new MailMessage();
> > > > mail.To = "me@mycompany.com";
> > > > mail.From = "yo*@yourcompany.com";
> > > > mail.Subject = "this is a test email.";
> > > > mail.Body = "Some text goes here";
> > > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > > port
> > > > number");
> > > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > > SmtpMail.Send(mail);
> > > >
> > > > There's VB.NET sample code in the same page.
> > > >
> > > > Keep that systemwebmail link handy.
> > > > All the info you need to solve web mail problems under .Net 1..1 is there.
> > > >
> > > > There's specific answers for both the "Could not access 'CDO.Message' object"
> > > > and "The transport failed to connect to the server" exceptions which you reported.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Juan T. Llibre, asp.net MVP
> > > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > > asp.net faq : http://asp.net.do/faq/
> > > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > > ===================================
> > > > <an***********@yahoo.com> wrote in message
> > > > news:11**********************@i39g2000cwa.googlegr oups.com...
> > > > Hi, Juan,
> > > >
> > > > Thanks a lot. Unfortunately, it looks like that the SmtpClient is only
> > > > available with .Net framework 2.0
> > > >
> > > > I am using .Net Framework 1.1
> > > >
> > > > I know nothing about 2.0 at this point of time. Is there anyway to go
> > > > around this?
> > > >
> > > > Juan T. Llibre wrote:
> > > > > re:
> > > > > >Too bad that the .Net SmtpMail class does not let us set the port number.
> > > > >
> > > > > But it does allow you to do that :
> > > > >
> > > > > static void ChangePort()
> > > > > {
> > > > > //create the mail message
> > > > > MailMessage mail = new MailMessage();
> > > > >
> > > > > //set the addresses
> > > > > mail.From = new MailAddress("me@mycompany.com");
> > > > > mail.To.Add("yo*@yourcompany.com");
> > > > >
> > > > > //set the content
> > > > > mail.Subject = "This is an email";
> > > > > mail.Body = "this is the body content of the email.";
> > > > >
> > > > > //send the message
> > > > > SmtpClient smtp = new SmtpClient("127.0.0.1");
> > > > >
> > > > > //to change the port (default is 25), we set the port property
> > > > > smtp.Port = 587;
> > > > > smtp.Send(mail);
> > > > > }
> > > > >
> > > > > Of course, for that to work you must set IIS's SMTP server
> > > > > to the same port you set in your code. You can use any TCP port.
> > > > >
> > > > > To do that, view the Properties of the Default SMTP Server;
> > > > > click the "Delivery" tab; click the "Outbound Connections" button;
> > > > > and set the port number you want in the "Tcp port" box.
> > > > >
> > > > > That will get around your ISP's blockage of port 25.
> > > > >
> > > > >
> > > > >
> > > > > Juan T. Llibre, asp.net MVP
> > > > > aspnetfaq.com : http://www.aspnetfaq.com/
> > > > > asp.net faq : http://asp.net.do/faq/
> > > > > foros de asp.net, en espaņol : http://asp.net.do/foros/
> > > > > ===================================
> > > > > <an***********@yahoo.com> wrote in message
> > > > > news:11**********************@i39g2000cwa.googlegr oups.com....
> > > > > Hi, Juan,
> > > > >
> > > > > Now I am having the typical "Could not access 'CDO.Message'object" and
> > > > > "The transport failed to connect to the server" exceptions.
> > > >
> > > > ------=_NextPart_000_0047_01C63EC2.E70415E0
> > > > Content-Type: text/html; charset=iso-8859-1
> > > > Content-Transfer-Encoding: quoted-printable
> > > > X-Google-AttachSize: 6344
> > > >
> > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > > <HTML><HEAD>
> > > > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> > > > <META content="MSHTML 6.00.3790.2577" name=GENERATOR>
> > > > <STYLE></STYLE>
> > > > </HEAD>
> > > > <BODY bgColor=#ffffff>
> > > > <DIV><FONT face=Arial size=2>re:<BR>&gt;I am using .Net Framework
> > > > 1.1<BR><BR>Youi'll find sample code for changing the port number under
> > > > system.web.amil here :<BR><BR></FONT><A
> > > > href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
> > > > size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
> > > > size=2>Essentially :<BR><BR></FONT><PRE class=csharp
> > > > onmouseover="this.style.cursor='hand';"
> > > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > > onclick=copyToClipboard(this);><FONT
> > > > face=Arial size=2>MailMessage mail = new MailMessage();
> > > > mail.To = "me@mycompany.com";
> > > > mail.From = "yo*@yourcompany.com";
> > > > mail.Subject = "this is a test email.";
> > > > mail.Body = "Some text goes here";
> > > > mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your
> > > > port
> > > > number");
> > > > SmtpMail.SmtpServer = "YourSmtpServer";
> > > > SmtpMail.Send(mail);
> > > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > > page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
> > > > solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
> > > > answers&nbsp;for both the "Could not access 'CDO.Message' object"
> > > > <BR>and&nbsp;"The transport failed to connect to the server" exceptions which
> > > > you reported.<BR></FONT></DIV>
> > > > <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
> > > > face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
> > > > size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > > <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > > > <DIV><BR><FONT face=Arial size=2>&nbsp;<BR>Juan T. Llibre, asp.net
> > > > MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq..com/"><FONT
> > > > face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
> > > > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
> > > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
> > > > asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
> > > > size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>&nbsp;
> > > > <BR>===================================</FONT></DIV>
> > > > <DIV><FONT face=Arial size=2>&lt;</FONT><A
> > > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arialsize=2>&gt; wrote in
> > > > message </FONT><A
> > > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > > face=Arial
> > > > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > > Juan,<BR><BR>Thanks a lot.&nbsp; Unfortunately, it looks likethat the
> > > > SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
> > > > face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
> > > > 2.0 at this point of time.&nbsp; Is there any way to go<BR>around
> > > > this?<BR><BR>Juan T. Llibre wrote:<BR>&gt; re:<BR>&gt; &gt;Too bad that the .Net
> > > > SmtpMail class does not let us set the port number.<BR>&gt;<BR>&gt; But it does
> > > > allow you to do that :<BR>&gt;<BR>&gt; static void ChangePort()<BR>&gt;
> > > > {<BR>&gt; //create the mail message<BR>&gt; MailMessage mail = new
> > > > MailMessage();<BR>&gt;<BR>&gt; //set the addresses<BR>&gt; mail.From = new
> > > > MailAddress("</FONT><A href="mailto:me@mycompany.com"><FONTface=Arial
> > > > size=2>me@mycompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;
> > > > mail.To.Add("</FONT><A href="mailto:yo*@yourcompany.com"><FONT face=Arial
> > > > size=2>yo*@yourcompany.com</FONT></A><FONT face=Arial size=2>");<BR>&gt;<BR>&gt;
> > > > //set the content<BR>&gt; mail.Subject = "This is an email";<BR>&gt; mail.Body =
> > > > "this is the body content of the email.";<BR>&gt;<BR>&gt; //send the
> > > > message<BR>&gt; SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>&gt;<BR>&gt;
> > > > //to change the port (default is 25), we set the port property<BR>&gt; smtp.Port
> > > > = 587;<BR>&gt; smtp.Send(mail);<BR>&gt; }<BR>&gt;<BR>&gt; Of course, for that to
> > > > work you must set IIS's SMTP server<BR>&gt; to the same port you set in your
> > > > code. You can use any TCP port.<BR>&gt;<BR>&gt; To do that, view the Properties
> > > > of the Default SMTP Server;<BR>&gt; click the "Delivery" tab;click the
> > > > "Outbound Connections" button;<BR>&gt; and set the port number you want in the
> > > > "Tcp port" box.<BR>&gt;<BR>&gt; That will get around your ISP's blockage of port
> > > > 25.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Juan T. Llibre, asp.net MVP<BR>&gt;
> > > > aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
> > > > size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > > > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONTface=Arial
> > > > size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>&gt; foros
> > > > de asp.net, en espaņol : </FONT><A href="http://asp.net.do/foros/"><FONT
> > > > face=Arial size=2>http://asp.net.do/foros/</FONT></A><BR><FONT face=Arial
> > > > size=2>&gt; ===================================<BR>&gt; &lt;</FONT><A
> > > > href="mailto:an***********@yahoo.com"><FONT face=Arial
> > > > size=2>an***********@yahoo.com</FONT></A><FONT face=Arialsize=2>&gt; wrote in
> > > > message<BR>&gt; </FONT><A
> > > > href="news:11**********************@i39g2000cwa.go oglegroups.com"><FONT
> > > > face=Arial
> > > > size=2>news:11**********************@i39g2000cwa.g ooglegroups.com</FONT></A><FONT
> > > > face=Arial size=2>...<BR>&gt; Hi, Juan,<BR>&gt;<BR>&gt; Now I am having the
> > > > typical "Could not access 'CDO.Message' object" and<BR>&gt; "The transport
> > > > failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
> > > >
> > > > ------=_NextPart_000_0047_01C63EC2.E70415E0--


Mar 6 '06 #35

This discussion thread is closed

Replies have been disabled for this discussion.