1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how can you make a asp SMTP script?

Discussion in 'C#' started by palme, Nov 3, 2008.

  1. #1
    How can you make a SMTP script in asp or
    is there any asp smtp script?
     
    palme, Nov 3, 2008 IP
  2. ranabra

    ranabra Peon

    Messages:
    125
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's built in. you don't need a 3rd party object.
    Depends on what environment you are using look for one of those
    CDONTS (older)
    CDO.Mail
    CDO.Message
     
    ranabra, Nov 4, 2008 IP
  3. OSi

    OSi Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Idd, this works fine.
     
    OSi, Nov 4, 2008 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    http://www.w3schools.com/asp/asp_send_email.asp
    < this pretty much explains it all
     
    camjohnson95, Nov 5, 2008 IP
  5. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Below is the script using CDO.
    Check it.
    
    <%
    Const cdoSendUsingMethod        = _
    	"http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSendUsingPort          = 2
    Const cdoSMTPServer             = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort         = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout  = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    Const cdoSMTPAuthenticate       = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    Const cdoBasic                  = 1
    Const cdoSendUserName           = _
    	"http://schemas.microsoft.com/cdo/configuration/sendusername"
    Const cdoSendPassword           = _
    	"http://schemas.microsoft.com/cdo/configuration/sendpassword"
    
    Dim objConfig  ' As CDO.Configuration
    Dim objMessage ' As CDO.Message
    Dim Fields     ' As ADODB.Fields
    
    ' Get a handle on the config object and it's fields
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    ' Set config fields we care about
    With Fields
    	.Item(cdoSendUsingMethod)       = cdoSendUsingPort
    	.Item(cdoSMTPServer)            = "smtp_server_name"
    	.Item(cdoSMTPServerPort)        = 25
    	.Item(cdoSMTPConnectionTimeout) = 10
    	.Item(cdoSMTPAuthenticate)      = cdoBasic
    	.Item(cdoSendUserName)          = "username"
    	.Item(cdoSendPassword)          = "password"
    
    	.Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    
    Set objMessage.Configuration = objConfig
    
    With objMessage
    	.To       = "Display Name <email_address>"
    	.From     = "Display Name <email_address>"
    	.Subject  = "SMTP Relay Test"
    	.TextBody = "SMTP Relay Test Sent @ " & Now()
    	.Send
    End With
    
    Set Fields = Nothing
    Set objMessage = Nothing
    Set ob
    
    Code (markup):
     
    VishalVasani, Nov 6, 2008 IP
  6. dinomflorist

    dinomflorist Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    use cdonts
     
    dinomflorist, Nov 16, 2008 IP