• edecker
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am looking to see if anyone could post sample code to get a web-to-lead form to work with .net. My main goal is to use the .net validation controls and still have the form post to the salesforce servers.

Message Edited by edecker on 11-03-2007 07:02 AM

Hello.  I'm trying to submit a lead via Web2Lead - but programatically.  Below is the essence of the code.  It isn't working.  I don't see any errors, but no lead is created and I don't get the resulting email.  If I create an HTML form and try it, it works perfectly.

I'm doing this programatically because I want to do multiple things with the info.  Send some emails, create a Lead, etc...

Thanks for your time.
Chris

Set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.Open "POST", "http://www.salesforce.com/servlet/servlet.WebToLead", False

QS = "debug=0"
QS = QS & "&encoding=UTF-8"
QS = QS & "&oid=my oid here"
QS = QS & "&debugEmail=my email addr here"
QS = QS & "&first_name=TEST"
QS = QS & "&last_name=TEST"
 

objHttp.Send QS
strResult = objHttp.responseText
Set objHttp = Nothing
 
response.write("[" & QS & "]<br>")
response.write("[" & strResult & "]<br>")
response.end