CDOSYS SMTP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MM User

    CDOSYS SMTP

    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.companyna me.co.uk) is there a way to set
    IIS to use the smtp server ?

    Thanks

  • Anthony Jones

    #2
    Re: CDOSYS SMTP

    "MM User" <mmuser@microso ft.comwrote in message
    news:ulAPnfW9IH A.4004@TK2MSFTN GP03.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.companyna me.co.uk) is there a way to
    set
    IIS to use the smtp server ?
    This is my stock CDOSYS emailling code:-

    Option Explicit

    Const cdoSendUsingMet hod =
    "http://schemas.microso ft.com/cdo/configuration/sendusing"
    Const cdoSMTPServer =
    "http://schemas.microso ft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPi ckupDirectory =
    "http://schemas.microso ft.com/cdo/configuration/smtpserverpicku pdirectory"
    Const cdoSMTPServerPo rt =
    "http://schemas.microso ft.com/cdo/configuration/smtpserverport"

    Const cdoSendUsingPic kup = 1
    Const cdoSendUsingPor t = 2

    Dim oMsg : Set oMsg = CreateObject("C DO.Message")
    Dim oConfig : Set oConfig = CreateObject("C DO.Configuratio n")

    With oConfig.Fields
    .Item(cdoSendUs ingMethod) = cdoSendUsingPor t
    .Item(cdoSMTPSe rver) = "smtp.companyna me.co.uk"
    .Item(cdoSMTPSe rverPort) = 25
    .Update
    End With

    oMsg.From = "Me <me@mymail.myse rver.com>"
    oMsg.To = "Bloke <bloke@somewere .com>"
    oMsg.Subject = "Test"
    oMsg.HTMLBody = "<html><body>He llo World</body></html>"
    Set oMsg.Configurat ion = oConfig

    oMsg.Send

    Note the SMTP server field here is being set using the server you specify.

    --
    Anthony Jones - MVP ASP/ASP.NET


    Comment

    Working...