CDO Mail and using asp code in htmlBody

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smanCometh
    New Member
    • May 2012
    • 4

    CDO Mail and using asp code in htmlBody

    I have a form that inserts into a database and then generates an email to me with a link. I need that link to be a url parameter back to the record based on record ID. The url will be something like http://www.website.com/web_request_edit.asp?ID=101. Currently the line of code I have been struggling with is:
    oMail.HTMLBody = "http://ocfs.state.nyen et/web_request_edi t.asp?ID=&web_r equests.fields. item('id').valu e&"

    Can someone give me the correct syntax?
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Code:
    oMail.HTMLBody = "http://ocfs.state.nyenet/web_request_edit.asp?ID=" & request("id")
    Jared

    Comment

    • smanCometh
      New Member
      • May 2012
      • 4

      #3
      That didn't work. That only gave me:
      http://ocfs.state.nyenet/web_request_edit.asp?ID.

      I need http://ocfs.state.nyenet/web_request_edit.asp?ID=102. Any ideas?

      Thanks

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        if that didn't work then you don't have a field "id" in your request object. Where does the id number come from?

        Jared

        Comment

        • smanCometh
          New Member
          • May 2012
          • 4

          #5
          It's an autonumber field in my sql table <%=(web_request s.Fields.Item(" ID").Value)%>

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            Code:
            oMail.HTMLBody = "http://ocfs.state.nyenet/web_request_edit.asp?ID=" & web_requests.Fields.Item("ID").Value
            does this work?

            Jared

            Comment

            • smanCometh
              New Member
              • May 2012
              • 4

              #7
              Yes!...that did the trick at last I have my functionality!. ..thank you Jared.

              Comment

              Working...