Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Thanked 0 Times in 0 Posts

    I have some code but....

    ok every1 i have a little bit of code, which is this
    Const cdoSendUsingMethod        = _
    Const cdoSendUsingPort          = 1
    Const cdoSMTPServer             = _
    Const cdoSMTPServerPort         = _
    Const cdoSMTPConnectionTimeout  = _
    Const cdoSMTPAuthenticate       = _
    Const cdoBasic                  = 1
    Const cdoSendUserName           = _
    Const cdoSendPassword           = _
    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)            = "mail.covelli.com"
    	.Item(cdoSMTPServerPort)        = 24
    	.Item(cdoSMTPConnectionTimeout) = 10
    	.Item(cdoSMTPAuthenticate)      = cdoBasic
    	.Item(cdoSendUserName)          = "molly.kinsey@covelli.com"
    	.Item(cdoSendPassword)          = "*******"
    End With
    Set objMessage = Server.CreateObject("CDO.Message")
    Set objMessage.Configuration = objConfig
    With objMessage
    	.To       = "chris.galati@covelli.com"
    	.From     = "molly.kinsey@covelli.com"
    	.Subject  = "SMTP Relay Test"
    	.TextBody = "SMTP Relay Test Sent @ " & Now()
    End With
    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing
    response.write "Mail sent successfully"
    Response.write("<script language=javascript> window.setTimeout ('window.location=""http://www.panera-tampa.com/index.html""',5000)</script>")
    i am trying to make this work with a form that i designed in html, which is hosted here www.panera-tampa.com/application.html I can't figure out how to make this asp file capture the information that is put into the form, then when u hit submit on the form have it email that information. Any help would be appreciated. I would love to talk to any of you on messenger just reply and i'll add you, or you can add me. Thanks for the help

  • #2
    New Coder
    Join Date
    Mar 2006
    Thanked 0 Times in 0 Posts

    how you do it

    well let's say you're using POST to send data from the form (i.e., <form method="post">), then you set the 'action' to be the name of your email sending script (so <form method="post" action="sendmail(or whatever).asp">). Then you'll have various input fields, looking something like:
    <input name="Subject" type="text" size=20 maxlength = 20>
    <input name="Body" type="text" size=20 maxlength = 20>

    So then, in your ASP script you use Request.Form("Subject") to retrieve the subject from the form. Same deal with "body" etc. Plug those values into the appropriate parts of the script you posted, and bob's your uncle.

    Of course, you should validate the form and also output some messages indicating success or otherwise of your script.

    Don't want to provide "live support", in any case I'm fairly new to ASP myself, but I hope this explanation is what you were after.
    "Laziness is the mother of invention" - Thomas Edison (not really)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts