473,761 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail sent through IIS virtual SMTP server not arriving

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="Syst em.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.Fro m = txtFrom.Text
mailMessage.To = txtTo.Text
mailMessage.Cc = txtCc.Text
mailMessage.Sub ject = "Test SMTP Message Send using port"
mailMessage.Bod y = txtName.Text & ", " &txtComments.Te xt
SmtpMail.SmtpSe rver = "127.0.0.1"

Try
SmtpMail.Send(m ailMessage)
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.InnerExcept ion Is Nothing)
Response.Write( "--------------------------------")
Response.Write( ("The following InnerException reported: "
+ ex.InnerExcepti on.ToString()))
ex = ex.InnerExcepti on
End While
End Try
End If
End Sub
</script>

The HTML that follows this code snippet is not pasted.

Mar 2 '06
34 18269
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\driver s\etc\

In the code, I still have to say

SmtpMail.SmtpSe rver = "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******** *************@p 10g2000cwp.goog legroups.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.goo glegroups.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.SmtpSe rver = "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.goo glegroups.com.. .
As a follow-up, I did Start>Run>event vwr.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\system 32\drivers\etc\ hosts )
>
> Then, in your code, assign your machine name to the smtp client :
>
> SmtpMail.SmtpSe rver = "YourMachineNam e";
> SmtpMail.Send(m ail);
>
> 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.goo glegroups.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...@5thbu siness.com>
> Groups: microsoft.publi c.inetserver.ii s
>
> 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.c om";
> > mail.From = "yo*@yourcompan y.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your port
> > number");
> > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > SmtpMail.Send(m ail);
> >
> > 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.goo glegroups.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.c om");
> > >
> > > //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.goo glegroups.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.E 70415E0
> > 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.c om/faq/2.9.aspx"><FONT face=Arial
> > size=2>http://systemwebmail.c om/faq/2.9.aspx</FONT></A><BR><BR><FON T face=Arial
> > size=2>Essentia lly :<BR><BR></FONT><PRE class=csharp onmouseover="th is.style.cursor ='hand';"
> > title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToC lipboard(this); ><FONT
> > face=Arial size=2>MailMess age mail = new MailMessage();
> > mail.To = "me@mycompany.c om";
> > mail.From = "yo*@yourcompan y.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your port
> > number");
> > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > SmtpMail.Send(m ail);
> > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > page.<BR><BR>Ke ep that systemwebmail link handy.<BR>All the info you need to
> > solve web mail problems under .Net 1.1 is there.<BR><BR>T here's specific
> > answers&nbsp;fo r both the "Could not access 'CDO.Message' object"
> > <BR>and&nbsp;"T he 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><FON T face=Arial size=2>&nbsp;<B R>Juan T. Llibre, asp.net
> > MVP<BR>aspnetfa q.com : </FONT><A href="http://www.aspnetfaq.c om/"><FONT
> > face=Arial size=2>http://www.aspnetfaq.c om/</FONT></A><FONT face=Arial size=2>
> > <BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONTface=Ari al
> > 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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > face=Arial
> > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > Juan,<BR><BR>Th anks a lot.&nbsp; Unfortunately, it looks like that the
> > SmtpClient is only<BR>availab le 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>Ju an 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>&g t; 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>&g t; mail.From = new
> > MailAddress("</FONT><A href="mailto:me @mycompany.com" ><FONT face=Arial
> > size=2>me@mycom pany.com</FONT></A><FONT face=Arial size=2>");<BR>& gt;
> > mail.To.Add("</FONT><A href="mailto:yo *@yourcompany.c om"><FONT face=Arial
> > size=2>yo*@your company.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>&g t;<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>&g t; 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;<B R>&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.c om/"><FONT face=Arial
> > size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > face=Arial
> > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > face=Arial size=2>...<BR>& gt; Hi, Juan,<BR>&gt;<B R>&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.E 70415E0--


Mar 5 '06 #31
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******** ************@v4 6g2000cwv.googl egroups.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\driver s\etc\

In the code, I still have to say

SmtpMail.SmtpSe rver = "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******** *************@p 10g2000cwp.goog legroups.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.goo glegroups.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.SmtpSe rver = "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.goo glegroups.com.. .
As a follow-up, I did Start>Run>event vwr.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\system 32\drivers\etc\ hosts )
>
> Then, in your code, assign your machine name to the smtp client :
>
> SmtpMail.SmtpSe rver = "YourMachineNam e";
> SmtpMail.Send(m ail);
>
> 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.goo glegroups.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...@5thbu siness.com>
> Groups: microsoft.publi c.inetserver.ii s
>
> 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.c om";
> > mail.From = "yo*@yourcompan y.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > port
> > number");
> > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > SmtpMail.Send(m ail);
> >
> > 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.goo glegroups.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.c om");
> > >
> > > //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.goo glegroups.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.E 70415E0
> > 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.c om/faq/2.9.aspx"><FONT face=Arial
> > size=2>http://systemwebmail.c om/faq/2.9.aspx</FONT></A><BR><BR><FON T face=Arial
> > size=2>Essentia lly :<BR><BR></FONT><PRE class=csharp
> > onmouseover="th is.style.cursor ='hand';"
> > title="Click to copy to clipboard" style="CURSOR: hand"
> > onclick=copyToC lipboard(this); ><FONT
> > face=Arial size=2>MailMess age mail = new MailMessage();
> > mail.To = "me@mycompany.c om";
> > mail.From = "yo*@yourcompan y.com";
> > mail.Subject = "this is a test email.";
> > mail.Body = "Some text goes here";
> > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > port
> > number");
> > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > SmtpMail.Send(m ail);
> > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > page.<BR><BR>Ke ep that systemwebmail link handy.<BR>All the info you need to
> > solve web mail problems under .Net 1.1 is there.<BR><BR>T here's specific
> > answers&nbsp;fo r both the "Could not access 'CDO.Message' object"
> > <BR>and&nbsp;"T he 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><FON T face=Arial size=2>&nbsp;<B R>Juan T. Llibre, asp.net
> > MVP<BR>aspnetfa q.com : </FONT><A href="http://www.aspnetfaq.c om/"><FONT
> > face=Arial size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > face=Arial
> > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > Juan,<BR><BR>Th anks a lot.&nbsp; Unfortunately, it looks like that the
> > SmtpClient is only<BR>availab le 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>Ju an 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>&g t; 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>&g t; mail.From = new
> > MailAddress("</FONT><A href="mailto:me @mycompany.com" ><FONT face=Arial
> > size=2>me@mycom pany.com</FONT></A><FONT face=Arial size=2>");<BR>& gt;
> > mail.To.Add("</FONT><A href="mailto:yo *@yourcompany.c om"><FONT face=Arial
> > size=2>yo*@your company.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>&g t;<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>&g t; 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;<B R>&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.c om/"><FONT face=Arial
> > size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > face=Arial
> > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > face=Arial size=2>...<BR>& gt; Hi, Juan,<BR>&gt;<B R>&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.E 70415E0--

Mar 5 '06 #32
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******** ************@v4 6g2000cwv.googl egroups.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\driver s\etc\

In the code, I still have to say

SmtpMail.SmtpSe rver = "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******** *************@p 10g2000cwp.goog legroups.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.goo glegroups.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.SmtpSe rver = "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.goo glegroups.com.. .
> As a follow-up, I did Start>Run>event vwr.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\system 32\drivers\etc\ hosts )
> >
> > Then, in your code, assign your machine name to the smtp client :
> >
> > SmtpMail.SmtpSe rver = "YourMachineNam e";
> > SmtpMail.Send(m ail);
> >
> > 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.goo glegroups.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...@5thbu siness.com>
> > Groups: microsoft.publi c.inetserver.ii s
> >
> > 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.c om";
> > > mail.From = "yo*@yourcompan y.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > port
> > > number");
> > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > SmtpMail.Send(m ail);
> > >
> > > 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.goo glegroups.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.c om");
> > > >
> > > > //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.goo glegroups.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.E 70415E0
> > > 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.c om/faq/2.9.aspx"><FONT face=Arial
> > > size=2>http://systemwebmail.c om/faq/2.9.aspx</FONT></A><BR><BR><FON T face=Arial
> > > size=2>Essentia lly :<BR><BR></FONT><PRE class=csharp
> > > onmouseover="th is.style.cursor ='hand';"
> > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > onclick=copyToC lipboard(this); ><FONT
> > > face=Arial size=2>MailMess age mail = new MailMessage();
> > > mail.To = "me@mycompany.c om";
> > > mail.From = "yo*@yourcompan y.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > port
> > > number");
> > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > SmtpMail.Send(m ail);
> > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > page.<BR><BR>Ke ep that systemwebmail link handy.<BR>All the info you need to
> > > solve web mail problems under .Net 1.1 is there.<BR><BR>T here'sspecific
> > > answers&nbsp;fo r both the "Could not access 'CDO.Message' object"
> > > <BR>and&nbsp;"T he 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><FON T face=Arial size=2>&nbsp;<B R>Juan T. Llibre, asp.net
> > > MVP<BR>aspnetfa q.com : </FONT><A href="http://www.aspnetfaq.c om/"><FONT
> > > face=Arial size=2>http://www.aspnetfaq.c om/</FONT></A><FONTface=Ari al 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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > face=Arial
> > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s..com</FONT></A><FONT
> > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > Juan,<BR><BR>Th anks a lot.&nbsp; Unfortunately, it looks like that the
> > > SmtpClient is only<BR>availab le 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>Ju an 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>&g t; 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>&g t; mail..From = new
> > > MailAddress("</FONT><A href="mailto:me @mycompany.com" ><FONT face=Arial
> > > size=2>me@mycom pany.com</FONT></A><FONT face=Arial size=2>");<BR>& gt;
> > > mail.To.Add("</FONT><A href="mailto:yo *@yourcompany.c om"><FONT face=Arial
> > > size=2>yo*@your company.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>&g t;<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>&g t; 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;<B R>&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.c om/"><FONT face=Arial
> > > size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > face=Arial
> > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s..com</FONT></A><FONT
> > > face=Arial size=2>...<BR>& gt; Hi, Juan,<BR>&gt;<B R>&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.E 70415E0--


Mar 5 '06 #33
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.c om> wrote in message news:11******** **************@ v46g2000cwv.goo glegroups.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******** ************@v4 6g2000cwv.googl egroups.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\driver s\etc\

In the code, I still have to say

SmtpMail.SmtpSe rver = "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******** *************@p 10g2000cwp.goog legroups.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.goo glegroups.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.SmtpSe rver = "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.goo glegroups.com.. .
> As a follow-up, I did Start>Run>event vwr.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\system 32\drivers\etc\ hosts )
> >
> > Then, in your code, assign your machine name to the smtp client :
> >
> > SmtpMail.SmtpSe rver = "YourMachineNam e";
> > SmtpMail.Send(m ail);
> >
> > 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.goo glegroups.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...@5thbu siness.com>
> > Groups: microsoft.publi c.inetserver.ii s
> >
> > 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.c om";
> > > mail.From = "yo*@yourcompan y.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > port
> > > number");
> > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > SmtpMail.Send(m ail);
> > >
> > > 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.goo glegroups.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.c om");
> > > >
> > > > //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.goo glegroups.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.E 70415E0
> > > 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.c om/faq/2.9.aspx"><FONT face=Arial
> > > size=2>http://systemwebmail.c om/faq/2.9.aspx</FONT></A><BR><BR><FON T face=Arial
> > > size=2>Essentia lly :<BR><BR></FONT><PRE class=csharp
> > > onmouseover="th is.style.cursor ='hand';"
> > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > onclick=copyToC lipboard(this); ><FONT
> > > face=Arial size=2>MailMess age mail = new MailMessage();
> > > mail.To = "me@mycompany.c om";
> > > mail.From = "yo*@yourcompan y.com";
> > > mail.Subject = "this is a test email.";
> > > mail.Body = "Some text goes here";
> > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > port
> > > number");
> > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > SmtpMail.Send(m ail);
> > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > page.<BR><BR>Ke ep that systemwebmail link handy.<BR>All the info you need to
> > > solve web mail problems under .Net 1.1 is there.<BR><BR>T here's specific
> > > answers&nbsp;fo r both the "Could not access 'CDO.Message' object"
> > > <BR>and&nbsp;"T he 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><FON T face=Arial size=2>&nbsp;<B R>Juan T. Llibre, asp.net
> > > MVP<BR>aspnetfa q.com : </FONT><A href="http://www.aspnetfaq.c om/"><FONT
> > > face=Arial size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > face=Arial
> > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > Juan,<BR><BR>Th anks a lot.&nbsp; Unfortunately, it looks like that the
> > > SmtpClient is only<BR>availab le 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>Ju an 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>&g t; 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>&g t; mail.From = new
> > > MailAddress("</FONT><A href="mailto:me @mycompany.com" ><FONT face=Arial
> > > size=2>me@mycom pany.com</FONT></A><FONT face=Arial size=2>");<BR>& gt;
> > > mail.To.Add("</FONT><A href="mailto:yo *@yourcompany.c om"><FONT face=Arial
> > > size=2>yo*@your company.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>&g t;<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>&g t; 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;<B R>&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.c om/"><FONT face=Arial
> > > size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > face=Arial
> > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > > face=Arial size=2>...<BR>& gt; Hi, Juan,<BR>&gt;<B R>&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.E 70415E0--

Mar 5 '06 #34
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.c om> wrote in message news:11******** **************@ v46g2000cwv.goo glegroups.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******** ************@v4 6g2000cwv.googl egroups.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\driver s\etc\

In the code, I still have to say

SmtpMail.SmtpSe rver = "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******** *************@p 10g2000cwp.goog legroups.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.goo glegroups.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.SmtpSe rver = "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.goo glegroups.com.. .
> > As a follow-up, I did Start>Run>event vwr.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\system 32\drivers\etc\ hosts )
> > >
> > > Then, in your code, assign your machine name to the smtp client:
> > >
> > > SmtpMail.SmtpSe rver = "YourMachineNam e";
> > > SmtpMail.Send(m ail);
> > >
> > > 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.goo glegroups.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...@5thbu siness.com>
> > > Groups: microsoft.publi c.inetserver.ii s
> > >
> > > 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.c om";
> > > > mail.From = "yo*@yourcompan y.com";
> > > > mail.Subject = "this is a test email.";
> > > > mail.Body = "Some text goes here";
> > > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > > port
> > > > number");
> > > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > > SmtpMail.Send(m ail);
> > > >
> > > > 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.goo glegroups.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.c om");
> > > > >
> > > > > //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.goo glegroups.com.. ..
> > > > > Hi, Juan,
> > > > >
> > > > > Now I am having the typical "Could not access 'CDO.Message'ob ject" and
> > > > > "The transport failed to connect to the server" exceptions.
> > > >
> > > > ------=_NextPart_000_ 0047_01C63EC2.E 70415E0
> > > > 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.c om/faq/2.9.aspx"><FONT face=Arial
> > > > size=2>http://systemwebmail.c om/faq/2.9.aspx</FONT></A><BR><BR><FON T face=Arial
> > > > size=2>Essentia lly :<BR><BR></FONT><PRE class=csharp
> > > > onmouseover="th is.style.cursor ='hand';"
> > > > title="Click to copy to clipboard" style="CURSOR: hand"
> > > > onclick=copyToC lipboard(this); ><FONT
> > > > face=Arial size=2>MailMess age mail = new MailMessage();
> > > > mail.To = "me@mycompany.c om";
> > > > mail.From = "yo*@yourcompan y.com";
> > > > mail.Subject = "this is a test email.";
> > > > mail.Body = "Some text goes here";
> > > > mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" , "your
> > > > port
> > > > number");
> > > > SmtpMail.SmtpSe rver = "YourSmtpServer ";
> > > > SmtpMail.Send(m ail);
> > > > </FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
> > > > page.<BR><BR>Ke ep that systemwebmail link handy.<BR>All the info you need to
> > > > solve web mail problems under .Net 1.1 is there.<BR><BR>T here's specific
> > > > answers&nbsp;fo r both the "Could not access 'CDO.Message' object"
> > > > <BR>and&nbsp;"T he 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><FON T face=Arial size=2>&nbsp;<B R>Juan T. Llibre, asp.net
> > > > MVP<BR>aspnetfa q.com : </FONT><A href="http://www.aspnetfaq.. com/"><FONT
> > > > face=Arial size=2>http://www.aspnetfaq.c om/</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 ***********@yah oo.com"><FONT face=Arial
> > > > size=2>an****** *****@yahoo.com </FONT></A><FONT face=Arialsize= 2>&gt; wrote in
> > > > message </FONT><A
> > > > href="news:11** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > > face=Arial
> > > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > > > face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
> > > > Juan,<BR><BR>Th anks a lot.&nbsp; Unfortunately, it looks likethat the
> > > > SmtpClient is only<BR>availab le 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>Ju an 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>&g t; 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>&g t; mail.From = new
> > > > MailAddress("</FONT><A href="mailto:me @mycompany.com" ><FONTface=Aria l
> > > > size=2>me@mycom pany.com</FONT></A><FONT face=Arial size=2>");<BR>& gt;
> > > > mail.To.Add("</FONT><A href="mailto:yo *@yourcompany.c om"><FONT face=Arial
> > > > size=2>yo*@your company.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>&g t;<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>&g t; 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;<B R>&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.c om/"><FONT face=Arial
> > > > size=2>http://www.aspnetfaq.c om/</FONT></A><BR><FONT face=Arial size=2>&gt;
> > > > asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONTface=Ari al
> > > > 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 ***********@yah oo.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** *************** *****@i39g2000c wa.googlegroups .com"><FONT
> > > > face=Arial
> > > > size=2>news:11* *************** ******@i39g2000 cwa.googlegroup s.com</FONT></A><FONT
> > > > face=Arial size=2>...<BR>& gt; Hi, Juan,<BR>&gt;<B R>&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.E 70415E0--


Mar 6 '06 #35

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
14062
bonski
by: bonski | last post by:
hello everybody.. i just want to know what this error means... Error: mail() : SMTP server response: 501 #5.1.1 bad address the smtp set up was correct.. valid emails... and port. so im just wondering why this error still occurs. looking forward for your suggestions.. thanks!
8
28256
by: punitshrivastava | last post by:
Hi to All. I am Punit .I am back with new question .Please help me. I want to create one enquiry form in php.for this I code it: form code: <form name="enquiry" method="post" action="enquiry.php">
2
6736
by: Ronald Raygun | last post by:
I am calling the mail() function in a PHP script and I get the ff error: Warning: mail() : SMTP server response: 501 5.5.4 Invalid Address in C:\test\test.php on line 394 Relevant Info: OS: Win2k Web Server Apache: v2.2.8
8
3324
by: aradhanathawait | last post by:
I tried a lot to send email from my gmail id using the smtp server of gmail.com but I am getting request time out error. I increased the execution time in web.config then also getting the same error. Please help me. Thanx n Regards, Aradhana
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9988
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.