SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Need Some help

  1. #1
    SitePoint Member
    Join Date
    Dec 2001
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Need Some help

    I use a sendmail asp program to send subscriber info to my email inbox. The script allows me to customize a message that appears after the info is submitted.
    I would rather have the user be directed to another html page. How do I change the asp script to accomplish this?

    Here is the present asp script:

    <%
    For Each x In Request.Form
    message=message & x & ": " & Request.Form(x) & CHR(10)
    Next

    set smtp = Server.CreateObject("Bamboo.SMTP")
    ' You only need to change the smtp.Rcpt ans smpt.from part to your email address
    smtp.Server = "mail.mysite.com"
    smtp.Rcpt = "admin@mysite.com"
    smtp.From = "admin@mysite.com"
    smtp.FromName = Request.ServerVariables("HTTP_REFERER")
    smtp.Subject = "Your web form - " & Request.ServerVariables("HTTP_REFERER")
    smtp.Message = message
    on error resume next
    smtp.Send
    if err then
    response.Write err.Description
    else
    response.Write ("Thank you for your request.")
    end if
    set smtp = Nothing
    %>

    Thanks for any help.

  2. #2
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try something like this:

    Code:
    <%
    
    	For Each Item In Request.Form
    		strMessage = strMessage & Item & ": " & Request.Form( Item ) & Chr(10)
    	Next
    	Set objMail = Server.CreateObject( "Bamboo.SMTP" )
    	objMail.Server = "mail.mysite.com"
    	objMail.Rcpt = "admin@mysite.com"
    	objMail.From = "admin@mysite.com"
    	objMail.FromName = Request.ServerVariables( "HTTP_REFERER" )
    	objMail.Subject = "Your web form - " & Request.ServerVariables( "HTTP_REFERER" )
    	objMail.Message = strMessage
    	On Error Resume Next
    	objMail.Send
    	Set objMail = Nothing : objMail = Empty
    	If Err Then Response.Redirect( "error.html" )
    	If Not Err Then Response.Redirect( "success.html" )
    
    %>
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  3. #3
    SitePoint Member
    Join Date
    Dec 2001
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Thanks KodeKrash

    Thanks KodeKrash

  4. #4
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <%
    For Each x In Request.Form
    message=message & x & ": " & Request.Form(x) & CHR(10)
    Next

    set smtp = Server.CreateObject("Bamboo.SMTP")
    ' You only need to change the smtp.Rcpt ans smpt.from part to your email address
    smtp.Server = "mail.mysite.com"
    smtp.Rcpt = "admin@mysite.com"
    smtp.From = "admin@mysite.com"
    smtp.FromName = Request.ServerVariables("HTTP_REFERER")
    smtp.Subject = "Your web form - " & Request.ServerVariables("HTTP_REFERER")
    smtp.Message = message
    on error resume next
    smtp.Send
    if err then
    response.Write err.Description
    else
    'response.Write ("Thank you. . . Erase this line")
    response.redirect "The page you want them to go to"
    end if
    set smtp = Nothing
    %>


Bookmarks

Posting Permissions

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