Results 1 to 6 of 6

Thread: asp forwarding script

  1. #1
    Join Date
    Apr 2005
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default asp forwarding script

    I run a small online quiz where the answers are sent o me via email on the click of a submit button.

    I have the following script on my server which processes the information and forwards an email to me with the answers and senders information.

    What I would like is for it also to send the same email to the sender, so they can check back on their answers when i publish the answers/results.

    I am guessing that there will be some code that i add to the recipient partof the script.

    Please could someone take a look at the script and tell me how and where i put the code

    Many Thanks

    Quiztoon





    <%
    SenderEmail = Request.Form("visitor_email_address")
    Subject = "Links Quiz Answers"
    Recipient = "linksquiz@quiztoon.co.uk"

    'Get Time / Date

    my_date = FormatDateTime(now(),1)
    my_time = FormatDateTime(now(),4)

    Body = "SUBMITTERS DETAILS - " & vbcrlf & vbcrlf

    Body = Body & "Submitted On : " & my_date & vbcrlf
    Body = Body & "Submitted At : " & my_time & " GMT" & vbcrlf
    Body = Body & "Submitted By : " & Request.Form("visitor_name") & vbcrlf
    Body = Body & "Email Address : " & Request.Form("visitor_email_address") & vbcrlf
    Body = Body & "Senders gender : " & Request.Form("gender") & vbcrlf & vbcrlf

    Body = Body & "ANSWERS SUBMITTED - " & vbcrlf & vbcrlf

    Body = Body & "Answer to Question 1 : " & Request.Form("answer1") & vbcrlf
    Body = Body & "Answer to Question 2 : " & Request.Form("answer2") & vbcrlf
    Body = Body & "Answer to Question 3 : " & Request.Form("answer3") & vbcrlf
    Body = Body & "Answer to Question 4 : " & Request.Form("answer4") & vbcrlf
    Body = Body & "Answer to Question 5 : " & Request.Form("answer5") & vbcrlf & vbcrlf

    Body = Body & "Answer to Link 1 : " & Request.Form("link1") & vbcrlf & vbcrlf

    Body = Body & "Answer to Question 6 : " & Request.Form("answer6") & vbcrlf
    Body = Body & "Answer to Question 7 : " & Request.Form("answer7") & vbcrlf
    Body = Body & "Answer to Question 8 : " & Request.Form("answer8") & vbcrlf
    Body = Body & "Answer to Question 9 : " & Request.Form("answer9") & vbcrlf
    Body = Body & "Answer to Question 10 : " & Request.Form("answer10") & vbcrlf & vbcrlf

    Body = Body & "Answer to Link 2 : " & Request.Form("link2") & vbcrlf & vbcrlf

    Body = Body & "SENDERS COMMENTS : " & vbcrlf & vbcrlf & Request.Form("comments")


    Set JMail = Server.CreateObject("JMail.SMTPMail")
    JMail.ServerAddress = "mail.quiztoon.co.uk"
    JMail.Sender = SenderEmail
    JMail.Subject = Subject
    JMail.AddRecipient Recipient
    JMail.Body = Body
    JMail.Priority = 1
    JMail.Execute

    Response.Redirect("thank_you.html")
    %>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    SenderEmail = Request.Form("visitor_email_address")
    Subject = "Links Quiz Answers"
    Recipient = "linksquiz@quiztoon.co.uk" & ", " & SenderEmail
    RFC2822 says you can send to multiple recipients seperated by commas.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2005
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you for that. However it doesnt work, when i hit submit i get another page showing this text.


    jmail.SMTPMail error '8000ffff'

    The message was undeliverable. All servers failed to receive the message

    /linksquiz/process_current.asp, line 46

    any other ideas or is there a place where i can actually re-write the whole script

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    OK, try...
    Code:
    Set JMail = Server.CreateObject("JMail.SMTPMail")
    JMail.ServerAddress = "mail.quiztoon.co.uk"
    JMail.Sender = SenderEmail
    JMail.Subject = Subject
    JMail.AddRecipient Recipient
    JMail.AddRecipient SenderEmail
    JMail.Body = Body
    JMail.Priority = 1
    JMail.Execute
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Apr 2005
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks again, but it still will not play.


    jmail.SMTPMail error '8000ffff'

    Error: 550 The following recipients could not be sent to:

    /linksquiz/process_current.asp, line 47


    line 47 or line 46 in the previous error is


    JMail.Execute


    Has that got anyhting to do with it?

    totally flummoxed now

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, that's just what's throwing the exception.
    It looks to me as if SenderEmail is blank. Make sure it's being passed properly.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •