Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP Virtual Server

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
I am trying to configure the SMTP Virtual Server on my web server to send all emails through my web server. How do I do this?? Not too sure about the whole FQDN and smart host thing.

Any help would be appreciated.

Mighty
 
If your doing this from within a web page, you can write a small script to do this

Pinched from Microsoft
Code:
With SMTP service installed
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "monitor1@fabrikam.com"
objEmail.To = "admin1@fabrikam.com"
objEmail.Subject = "Atl-dc-01 down" 
objEmail.Textbody = "Atl-dc-01 is no longer accessible over the network."
objEmail.Send
'Or Without service installed
Code:
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "admin1@fabrikam.com"
objEmail.To = "admin2@fabrikam.com"
objEmail.Subject = "Server down" 
objEmail.Textbody = "Server1 is no longer accessible over the network."
objEmail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
objEmail.Configuration.Fields.Item _
    ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = _
        "MySMTPHost" 
objEmail.Configuration.Fields.Item _
    ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
objEmail.Configuration.Fields.Update
objEmail.Send

Regards ACO
 
ACO,

Thanks for the detailed response but I think that we are on different wavelengths. I know how to actually send the emails. I already use CDO in my code to send the emails. The problem is this: at present, my websites reside on the same server as the webserver. For this reason, all mails are sent without any problems as any mails that I send from the webserver are automatically sent from the Exchange server as they are one and the same.

However, I have just bought a new server and will use this to host my websites. Now I need to know how to set up this new server so that it will route all emails through the new server - without having to change code in every single one of my programs.

My development machine is a Win2K workstation and I am able to send emails from it so I am sure that it must be possible to send emails from the new server - just can't get it to work????

Mighty
 
Sorry for delay,
I have to admit that I dont know exchange very well as we dont use it. However, I do know that the SMTP service installed when you install IIS on a server can be configured to pass mail to your exchange server pretty simply.

I.E. set up new webserver and make sure SMTP is installed at same time (default setting of IIS install). virtual server and set config

Sorry I can be more help.
Regards ACO
 
or, go to google and search for:

configure smtp server
 
I currently send emails from a web server through a separate exchange server -
you have to make sure the SMTP service is started automatically on the web server
then on the Exchange Server STMP Virtual Server Properties- you want to set it so that it allows relays (access tab) from the IP adress of the Web server.

I think that is all there is to it.
 
I configured the STMP Virtual Server on my local machine (Win2K Workstation) as per the link provided by Dashard to try to test it out. I managed to get it to send mails to my local domain using CDONTS but it won't send outside my domain.

As per SinginVic's suggestion, I don't have the SMTP Virtual Server started on the Exchange Server as it was causing a conflict with Exchange. Exchange has to have sole access to port 25 otherwise it causes mail delivery issues. I tried to set up Exchange to allow relays but the Routing restrictions button is disabled under the routing tab and I need to go into the restrictions to add the IP address of my web server. I am really lost as to how to get this working.

Mighty
 
The problem seems to be something to do with the configuration of CDOSYS. I have set up on SMTP Virtual Server on my local machine as was able to send an email to an internal and external email address using CDONTS.

However, when I tried to send exactly the same email using CDOSYS, it didn't get delivered to my internal or external address. I didn't specify any configuration options - just changed CDONTS.NewMail to CDO.Message and replaced objMail.Body with objMail.HTMLBody.

Any ideas??

Mighty
 
Got it sorted eventually. After messing around with various configuration options it turned out to be a firewall issue. Only found this out after monitoring the log file from my local SMTP server and the webserver SMTP log file.

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top