Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: system.web.mail and smtp server


Message #1 by "Mitchell Adams" <MADAMS@p...> on Fri, 06 Sep 2002 09:09:58 -0400
Does the system.web.mail class use the same smtp service that is installed 
on the .net box?

Is there a way to set it to a different server?   i.e.  SmtpMail.SmtpServer
 =3D "mail.domain.com"

Mitch



Message #2 by "Sampath, Ramanujam (Cognizant)" <SRamanuj@c...> on Fri, 6 Sep 2002 19:47:43 +0530
sure u an do it.....


==============================
S.Ramanujam
Programmer Analyst
Cognizant Technology Solutions (p) Ltd. - CTS
38 & 39 Whites Road,
WCB - Whites Road Circular Building
Royapettah, Chennai - 600014
Ph : +xx xx xxx xxxx Extn 5113 [Off]
     : +xx xx xxx xxxx                 [Res]


-----Original Message-----
From: Mitchell Adams [mailto:MADAMS@p...]
Sent: Friday, September 06, 2002 6:40 PM
To: ASP+
Subject: [aspx] system.web.mail and smtp server



Does the system.web.mail class use the same smtp service that is installed
on the .net box?

Is there a way to set it to a different server?   i.e.  SmtpMail.SmtpServer
= "mail.domain.com"

Mitch




---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces 
for developers who are already familiar with using ASP.NET. 
There is no trivial introductory material or useless .NET 
hype and the presentation of the namespaces, in an easy-to use 
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes, 
giving you those real-world tips that the documentation doesn't 
offer, and demonstrating complex techniques with simple 
examples.  

---

Message #3 by Imar Spaanjaars <Imar@S...> on Fri, 06 Sep 2002 18:06:31 +0200
Yes, exactly that.

It defaults to an SMTP server at the localhost, but you can override it 
like this:

         SmtpMail.SmtpServer = "smtp.MyDomain.com"
         SmtpMail.Send(objMailMessage)

Imar



At 09:09 AM 9/6/2002 -0400, you wrote:

>Does the system.web.mail class use the same smtp service that is installed 
>on the .net box?
>
>Is there a way to set it to a different 
>server?   i.e.  SmtpMail.SmtpServer = "mail.domain.com"
>
>Mitch


Message #4 by "Albert Davis" <albertdavis@h...> on Fri, 06 Sep 2002 12:29:14 -0400
Mitch,

System.Web.Mail does use the same SMTP Service that is installed within IIS 
if that is the service that you are using for outbound EMail.  To my 
knowledge (and I have only been using Microsoft's SMTP within IIS) you won't 
be able to specify (or I haven't done enough searching for it) where you 
want your mail to relay to within .NET.  Usually (at least for the clients 
that I have done this for) they have an Exchange 5.5/2000 Server set-up.  In 
mostly all of these cases they need the mail to be forwarded from the IIS 
SMTP Server to the Exchange 2000 for relay.  So to .NET it's transparent in 
where the actual setting are done on the local SMTP Server itself.  If you 
are using the SMTP Server within IIS all you need to do to accomplish this 
is:

1) Open up the properties dialog for the IIS SMTP Server
2) Click on the Delivery tab
3) Click on the Advanced button
4) Within the Masquerade domain text box type in your domain name so that it 
appears within the "from" field within the STMP Header Message itself (this 
will protect you from email servers that block all non-FQDN mail ie. 
*spammers*)
5) Within the Smart host text box type in your Exchanges Email Servers FQDN 
or IP address (this tells the SMTP Server to forward all outbound messages 
to this address for relay)
7) Apply the settings, restart the SMTP Service (don't know if restarting 
actually needs to be done - but I do it anyway just in case)

FYI, make sure the Exchange Server that is accepting the relay has the 
setting to let that IIS SMTP machine relay against it or your mail will be 
blocked due to that Exchange Servers configuration thinking that it is 
trying to be used as an open relay in which it should deny it.

hth,
Al


>From: "Mitchell  Adams" <MADAMS@p...>
>Reply-To: "ASP+" <aspx@p...>
>To: "ASP+" <aspx@p...>
>Subject: [aspx] system.web.mail and smtp server
>Date: Fri, 06 Sep 2002 09:09:58 -0400
>
>
>Does the system.web.mail class use the same smtp service that is installed 
>on the .net box?
>
>Is there a way to set it to a different server?   i.e.  SmtpMail.SmtpServer 
>= "mail.domain.com"
>
>Mitch
>
>
>
>
>---
>
>ASP.NET 1.0 Namespace Reference with C#
>http://www.wrox.com/acon11.asp?ISBN=1861007442
>
>ASP.NET 1.0 Namespace Reference with VB.NET
>http://www.wrox.com/acon11.asp?ISBN=1861007450
>
>These books are a complete reference to the ASP.NET namespaces
>for developers who are already familiar with using ASP.NET.
>There is no trivial introductory material or useless .NET
>hype and the presentation of the namespaces, in an easy-to use
>alphabetical order ensures a user-friendly reference format.
>We provide in-depth coverage of all the major ASP.NET classes,
>giving you those real-world tips that the documentation doesn't
>offer, and demonstrating complex techniques with simple
>examples.
>
>---




_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

Message #5 by "Albert Davis" <albertdavis@h...> on Fri, 06 Sep 2002 12:30:17 -0400
Ah, or use Imar's suggestion...


>From: Imar Spaanjaars <Imar@S...>
>Reply-To: "ASP+" <aspx@p...>
>To: "ASP+" <aspx@p...>
>Subject: [aspx] Re: system.web.mail and smtp server
>Date: Fri, 06 Sep 2002 18:06:31 +0200
>
>Yes, exactly that.
>
>It defaults to an SMTP server at the localhost, but you can override it 
>like this:
>
>         SmtpMail.SmtpServer = "smtp.MyDomain.com"
>         SmtpMail.Send(objMailMessage)
>
>Imar
>
>
>
>At 09:09 AM 9/6/2002 -0400, you wrote:
>
>>Does the system.web.mail class use the same smtp service that is installed 
>>on the .net box?
>>
>>Is there a way to set it to a different server?   i.e.  
>>SmtpMail.SmtpServer = "mail.domain.com"
>>
>>Mitch
>
>
>
>---
>
>ASP.NET 1.0 Namespace Reference with C#
>http://www.wrox.com/acon11.asp?ISBN=1861007442
>
>ASP.NET 1.0 Namespace Reference with VB.NET
>http://www.wrox.com/acon11.asp?ISBN=1861007450
>
>These books are a complete reference to the ASP.NET namespaces for 
>developers who are already familiar with using ASP.NET. There is no trivial 
>introductory material or useless .NET hype and the presentation of the 
>namespaces, in an easy-to use alphabetical order ensures a user-friendly 
>reference format.
>We provide in-depth coverage of all the major ASP.NET classes, giving you 
>those real-world tips that the documentation doesn't offer, and 
>demonstrating complex techniques with simple examples.
>
>---
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or to 
>unsubscribe send a blank email to 




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

Message #6 by Imar Spaanjaars <Imar@S...> on Fri, 06 Sep 2002 19:07:01 +0200
Ah, or use Albert's suggestion... ;-)

His solution would work as well (as a matter of fact, that's how we 
"rerouted" messages before the .NET era).

(Dis)advantage (depending how you look at it) is that it now sends most 
messages through this smart host without the ability to decide which host 
to use for what message. Like I said, this can be a good thing as well if 
that's what you're after.

Cheers,

Imar



At 12:29 PM 9/6/2002 -0400, you wrote:
>Mitch,
>
>System.Web.Mail does use the same SMTP Service that is installed within 
>IIS if that is the service that you are using for outbound EMail.  To my 
>knowledge (and I have only been using Microsoft's SMTP within IIS) you 
>won't be able to specify (or I haven't done enough searching for it) where 
>you want your mail to relay to within .NET.  Usually (at least for the 
>clients that I have done this for) they have an Exchange 5.5/2000 Server 
>set-up.  In mostly all of these cases they need the mail to be forwarded 
>from the IIS SMTP Server to the Exchange 2000 for relay.  So to .NET it's 
>transparent in where the actual setting are done on the local SMTP Server 
>itself.  If you are using the SMTP Server within IIS all you need to do to 
>accomplish this is:
>
>1) Open up the properties dialog for the IIS SMTP Server
>2) Click on the Delivery tab
>3) Click on the Advanced button
>4) Within the Masquerade domain text box type in your domain name so that 
>it appears within the "from" field within the STMP Header Message itself 
>(this will protect you from email servers that block all non-FQDN mail ie. 
>*spammers*)
>5) Within the Smart host text box type in your Exchanges Email Servers 
>FQDN or IP address (this tells the SMTP Server to forward all outbound 
>messages to this address for relay)
>7) Apply the settings, restart the SMTP Service (don't know if restarting 
>actually needs to be done - but I do it anyway just in case)
>
>FYI, make sure the Exchange Server that is accepting the relay has the 
>setting to let that IIS SMTP machine relay against it or your mail will be 
>blocked due to that Exchange Servers configuration thinking that it is 
>trying to be used as an open relay in which it should deny it.
>
>hth,
>Al


Message #7 by "Mitchell Adams" <MADAMS@p...> on Fri, 06 Sep 2002 13:16:47 -0400
Thanks for all the help.....

Mitch



>>> Imar@S... 09/06/02 01:07PM >>>
Ah, or use Albert's suggestion... ;-)

His solution would work as well (as a matter of fact, that's how we
"rerouted" messages before the .NET era).

(Dis)advantage (depending how you look at it) is that it now sends most
messages through this smart host without the ability to decide which 
host
to use for what message. Like I said, this can be a good thing as well 
if
that's what you're after.

Cheers,

Imar



At 12:29 PM 9/6/2002 -0400, you wrote:
>Mitch,
>
>System.Web.Mail does use the same SMTP Service that is installed 
within
>IIS if that is the service that you are using for outbound EMail.  To 
my
>knowledge (and I have only been using Microsoft's SMTP within IIS) you
>won't be able to specify (or I haven't done enough searching for it) 
where
>you want your mail to relay to within .NET.  Usually (at least for the
>clients that I have done this for) they have an Exchange 5.5/2000 
Server
>set-up.  In mostly all of these cases they need the mail to be 
forwarded
>from the IIS SMTP Server to the Exchange 2000 for relay.  So to .NET 
it's
>transparent in where the actual setting are done on the local SMTP 
Server
>itself.  If you are using the SMTP Server within IIS all you need to do 
to
>accomplish this is:
>
>1) Open up the properties dialog for the IIS SMTP Server
>2) Click on the Delivery tab
>3) Click on the Advanced button
>4) Within the Masquerade domain text box type in your domain name so 
that
>it appears within the "from" field within the STMP Header Message 
itself
>(this will protect you from email servers that block all non-FQDN mail 
ie.
>*spammers*)
>5) Within the Smart host text box type in your Exchanges Email Servers
>FQDN or IP address (this tells the SMTP Server to forward all outbound
>messages to this address for relay)
>7) Apply the settings, restart the SMTP Service (don't know if restarting

>actually needs to be done - but I do it anyway just in case)
>
>FYI, make sure the Exchange Server that is accepting the relay has the
>setting to let that IIS SMTP machine relay against it or your mail will 
be
>blocked due to that Exchange Servers configuration thinking that it is
>trying to be used as an open relay in which it should deny it.
>
>hth,
>Al



---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---


  Return to Index