Re: Mail sent through IIS virtual SMTP server not arriving
- From: "antonyliu2002@xxxxxxxxx" <antonyliu2002@xxxxxxxxx>
- Date: 3 Mar 2006 11:11:17 -0800
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/microsoft.public.inetserver.iis/browse_thread/thread/555467a64e9cf69a/9675868e46c5729c?q=Wei-Dong+Xu+SMTP+server+configuration+&rnum=1#9675868e46c5729c
From: Leszek - view profile
Date: Tues, Sep 9 2003 7:39 am
Email: "Leszek" <tarat...@xxxxxxxxxxxxxxx>
Groups: microsoft.public.inetserver.iis
Thank you very much.
There were several problems with my IIS configuration (smart host, smtp
server name etc). Moreover it turned out that I needed to set up a real
sender address (From: field) to enforce the IIS to send emails. Strange
but now it works perfectly.
Juan T. Llibre wrote:
re:
I am using .Net Framework 1.1
Youi'll find sample code for changing the port number under system.web.amil here :
http://systemwebmail.com/faq/2.9.aspx
Essentially :
MailMessage mail = new MailMessage();
mail.To = "me@xxxxxxxxxxxxx";
mail.From = "you@xxxxxxxxxxxxxxx";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
There's VB.NET sample code in the same page.
Keep that systemwebmail link handy.
All the info you need to solve web mail problems under .Net 1.1 is there.
There's specific answers for both the "Could not access 'CDO.Message' object"
and "The transport failed to connect to the server" exceptions which you reported.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<antonyliu2002@xxxxxxxxx> wrote in message news:1141403139.000632.184690@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxx");
mail.To.Add("you@xxxxxxxxxxxxxxx");
//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/
===================================
<antonyliu2002@xxxxxxxxx> wrote in message
news:1141364101.185493.190200@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, Juan,
Now I am having the typical "Could not access 'CDO.Message' object" and
"The transport failed to connect to the server" exceptions.
------=_NextPart_000_0047_01C63EC2.E70415E0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 6344
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>re:<BR>>I am using .Net Framework
1.1<BR><BR>Youi'll find sample code for changing the port number under
system.web.amil here :<BR><BR></FONT><A
href="http://systemwebmail.com/faq/2.9.aspx"><FONT face=Arial
size=2>http://systemwebmail.com/faq/2.9.aspx</FONT></A><BR><BR><FONT face=Arial
size=2>Essentially :<BR><BR></FONT><PRE class=csharp onmouseover="this.style.cursor='hand';" title="Click to copy to clipboard" style="CURSOR: hand" onclick=copyToClipboard(this);><FONT face=Arial size=2>MailMessage mail = new MailMessage();
mail.To = "me@xxxxxxxxxxxxx";
mail.From = "you@xxxxxxxxxxxxxxx";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "YourSmtpServer";
SmtpMail.Send(mail);
</FONT></PRE><BR><FONT face=Arial size=2>There's VB.NET sample code in the same
page.<BR><BR>Keep that systemwebmail link handy.<BR>All the info you need to
solve web mail problems under .Net 1.1 is there.<BR><BR>There's specific
answers for both the "Could not access 'CDO.Message' object"
<BR>and "The transport failed to connect to the server" exceptions which
you reported.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial size=2> <BR>Juan T. Llibre, asp.net
MVP<BR>aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT
face=Arial size=2>http://www.aspnetfaq.com/</FONT></A><FONT face=Arial size=2>
<BR>asp.net faq : </FONT><A href="http://asp.net.do/faq/"><FONT face=Arial
size=2>http://asp.net.do/faq/</FONT></A><BR><FONT face=Arial size=2>foros de
asp.net, en español : </FONT><A href="http://asp.net.do/foros/"><FONT face=Arial
size=2>http://asp.net.do/foros/</FONT></A><FONT face=Arial size=2>
<BR>===================================</FONT></DIV>
<DIV><FONT face=Arial size=2><</FONT><A
href="mailto:antonyliu2002@xxxxxxxxx"><FONT face=Arial
size=2>antonyliu2002@xxxxxxxxx</FONT></A><FONT face=Arial size=2>> wrote in
message </FONT><A
href="news:1141403139.000632.184690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx"><FONT
face=Arial
size=2>news:1141403139.000632.184690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>Hi,
Juan,<BR><BR>Thanks a lot. Unfortunately, it looks like that the
SmtpClient is only<BR>available with .Net framework 2.0<BR></FONT><FONT
face=Arial size=2><BR>I am using .Net Framework 1.1<BR><BR>I know nothing about
2.0 at this point of time. Is there any way to go<BR>around
this?<BR><BR>Juan T. Llibre wrote:<BR>> re:<BR>> >Too bad that the .Net
SmtpMail class does not let us set the port number.<BR>><BR>> But it does
allow you to do that :<BR>><BR>> static void ChangePort()<BR>>
{<BR>> //create the mail message<BR>> MailMessage mail = new
MailMessage();<BR>><BR>> //set the addresses<BR>> mail.From = new
MailAddress("</FONT><A href="mailto:me@xxxxxxxxxxxxx"><FONT face=Arial
size=2>me@xxxxxxxxxxxxx</FONT></A><FONT face=Arial size=2>");<BR>>
mail.To.Add("</FONT><A href="mailto:you@xxxxxxxxxxxxxxx"><FONT face=Arial
size=2>you@xxxxxxxxxxxxxxx</FONT></A><FONT face=Arial size=2>");<BR>><BR>>
//set the content<BR>> mail.Subject = "This is an email";<BR>> mail.Body =
"this is the body content of the email.";<BR>><BR>> //send the
message<BR>> SmtpClient smtp = new SmtpClient("127.0.0.1");<BR>><BR>>
//to change the port (default is 25), we set the port property<BR>> smtp.Port
= 587;<BR>> smtp.Send(mail);<BR>> }<BR>><BR>> Of course, for that to
work you must set IIS's SMTP server<BR>> to the same port you set in your
code. You can use any TCP port.<BR>><BR>> To do that, view the Properties
of the Default SMTP Server;<BR>> click the "Delivery" tab; click the
"Outbound Connections" button;<BR>> and set the port number you want in the
"Tcp port" box.<BR>><BR>> That will get around your ISP's blockage of port
25.<BR>><BR>><BR>><BR>> Juan T. Llibre, asp.net MVP<BR>>
aspnetfaq.com : </FONT><A href="http://www.aspnetfaq.com/"><FONT face=Arial
size=2>http://www.aspnetfaq.com/</FONT></A><BR><FONT face=Arial size=2>>
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><BR><FONT face=Arial
size=2>> ===================================<BR>> <</FONT><A
href="mailto:antonyliu2002@xxxxxxxxx"><FONT face=Arial
size=2>antonyliu2002@xxxxxxxxx</FONT></A><FONT face=Arial size=2>> wrote in
message<BR>> </FONT><A
href="news:1141364101.185493.190200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx"><FONT
face=Arial
size=2>news:1141364101.185493.190200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx</FONT></A><FONT
face=Arial size=2>...<BR>> Hi, Juan,<BR>><BR>> Now I am having the
typical "Could not access 'CDO.Message' object" and<BR>> "The transport
failed to connect to the server" exceptions.<BR></FONT></BODY></HTML>
------=_NextPart_000_0047_01C63EC2.E70415E0--
.
- Follow-Ups:
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Juan T. Llibre
- Re: Mail sent through IIS virtual SMTP server not arriving
- References:
- Mail sent through IIS virtual SMTP server not arriving
- From: antonyliu2002@xxxxxxxxx
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Bruce Barker
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: antonyliu2002@xxxxxxxxx
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Juan T. Llibre
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: antonyliu2002@xxxxxxxxx
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Juan T. Llibre
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: antonyliu2002@xxxxxxxxx
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Juan T. Llibre
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: antonyliu2002@xxxxxxxxx
- Re: Mail sent through IIS virtual SMTP server not arriving
- From: Juan T. Llibre
- Mail sent through IIS virtual SMTP server not arriving
- Prev by Date: .NET, do I need version 2.0?
- Next by Date: Re: .NET validation controls
- Previous by thread: Re: Mail sent through IIS virtual SMTP server not arriving
- Next by thread: Re: Mail sent through IIS virtual SMTP server not arriving
- Index(es):