CDOSYS SMTP

M

MM User

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 ?

Thanks
 
A

Anthony Jones

MM User said:
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 <[email protected]>"
oMsg.To = "Bloke <[email protected]>"
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top