Hello,
I am trying to execute a PHP Script that sends an email populated with variable from a vb6 form. I am trying to use the post method, but not sure this is even the best way to accomplish my goal here is what I have:
It Appears to go off with out a hitch It runs through all the connection code with no errors I just never get an email. I am pretty sure it is not the PHP portion however since if I access it though a browser window I do get an email.
The problem is in your HTTP request. I recognise it from the reply I gave Electroman earlier. Let me explain it a little more.
\r\n is the PHP escape sequence for the carridge return and new line characters. Each header in the HTTP request must be seaparted by a CRLF line ending. As VB does not understand \r\n you need to use the vbCrLF constant. To signify the end of the headers and the start of the content we use a blank line.
The Content-Length header must be the exact number of characters in your message body. In this case you've used 65, which is incroeect.
The third problem, is you have told the server you will be using URL encoding in the message body but the data is not encoded properly. Namely the space hasn't been converted to %20 or a + chracter.
Yes My php script is executed but the the variables are not passed. I am posting a copy of my form if you enter a valid email address you should get a email contaning Hello [first name] [last name].
My mistake, you should be sending the Content-Type header, not the Content-Encoding header. Also, make sure the HTTP request looks like this and uses the HTTP 1.0 otherwise the server may send back a chunked response, which needs to be re-assembled.