"MM User" <mm****@microsoft.comwrote in message
news:ul**************@TK2MSFTNGP03.phx.gbl...
Hi,
I'm using CDOSYS for sending out emails, while designing my asp pages
locally I need to set the server to localhost, however for production I
need
to set it to our smtp server (smtp.companyname.co.uk) is there a way to
set
IIS to use the smtp server ?
This is my stock CDOSYS emailling code:-
Option Explicit
Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSMTPServer =
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPickupDirectory =
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
Const cdoSMTPServerPort =
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Dim oMsg : Set oMsg = CreateObject("CDO.Message")
Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
With oConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.companyname.co.uk"
.Item(cdoSMTPServerPort) = 25
.Update
End With
oMsg.From = "Me <me@mymail.myserver.com>"
oMsg.To = "Bloke <bl***@somewere.com>"
oMsg.Subject = "Test"
oMsg.HTMLBody = "<html><body>Hello World</body></html>"
Set oMsg.Configuration = oConfig
oMsg.Send
Note the SMTP server field here is being set using the server you specify.
--
Anthony Jones - MVP ASP/ASP.NET