how to send email from an asp page ?

Discussion in 'ASP General' started by Sivaswami Jeganathan, Mar 24, 2006.

  1. how to send email from an asp page ?

    --
    Sivaswami Jeganathan
     
    Sivaswami Jeganathan, Mar 24, 2006
    #1
    1. Advertising

  2. Sivaswami Jeganathan

    Slim Guest

    "Sivaswami Jeganathan" <> wrote in message
    news:...
    > how to send email from an asp page ?
    >
    > --
    > Sivaswami Jeganathan
    >
    >




    try this, exchange server example below, remote server below that


    ' via stmp
    Sub sendEmail(whoTo, subject, body)
    Dim iMsg
    Dim iConf
    Dim Flds
    Const cdoSendUsingPickup = 1
    Const strPickup = "c:\Inetpub\mailroot\pickup"
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = iMsg.Configuration
    With iConf.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
    cdoSendUsingPickup
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")
    = strPickup
    .Update
    End With
    With iMsg
    .To = whoTo
    .From = ""
    .subject = subject
    .HTMLBody = body
    .Send
    End With
    End Sub

    'via exchange pickup
    Sub sendEmail(whoTo, subject, body)
    Dim iMsg
    Dim iConf
    Dim Flds
    Const cdoSendUsingPickup = 1
    Const strPickup = "c:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp"
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = iMsg.Configuration
    With iConf.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
    cdoSendUsingPickup
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")
    = strPickup
    .Update
    End With
    With iMsg
    .To = whoTo
    .From = ""
    .subject = subject
    .HTMLBody = body
    .Send
    End With
    End Sub

    'via remote server
    Sub sendEmail(whoTo, subject, body)
    Dim iMsg
    Dim iConf
    Dim Flds
    Const mailServer = "yourmailserver.com.au"
    Const cdoSendUsingPickup = 2
    'Const strPickup = "c:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp"
    Const strPickup = "c:\Inetpub\mailroot\pickup"
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = iMsg.Configuration
    With iConf.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
    cdoSendUsingPickup
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    mailServer
    .Update
    End With
    With iMsg
    .To = whoTo
    .From = ""
    .subject = subject
    .HTMLBody = body
    .Send
    End With
    End Sub
     
    Slim, Mar 24, 2006
    #2
    1. Advertising

  3. Kyle Peterson, Mar 25, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter
    Replies:
    0
    Views:
    3,374
    Peter
    Jul 1, 2003
  2. Replies:
    2
    Views:
    410
    Tintin
    Jan 5, 2007
  3. Replies:
    13
    Views:
    489
    Randy Webb
    May 14, 2006
  4. pbd22
    Replies:
    1
    Views:
    155
  5. ashish makani
    Replies:
    5
    Views:
    607
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page