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.
This corrected version should work:
VB Code:
Private Sub Winsock1_Connect()
Dim strHttpRequest As String
Dim strPHP As String
Dim strData As String
Dim intContentLength As Integer
strData = "Var1=Jesse&Var2=21&Var3=Fort+Collins"
intContentLength = Len(strData)
strPHP = Text4 & "/vbMail.php"
strHttpRequest = "POST " & strPHP & " HTTP/1.0" & vbCrLf & _
" Content-Length:" & intContentLength & vbCrLf & _
" Content-Type: application/x-www-from-urlencoded" & vbCrLf & _
vbCrLf & strData
Winsock1.SendData strHttpRequest
End Sub