You could upload the file to an FTP server using passive FTP.
You could include the text string as a parameter in HTTP request. Ex: "http://192.168.0.1/serversideprogram?whatever=text"
You could set up an email account, and have the program use that email account's SMTP server. However, if someone gets the password from your program, they could use the account for spamming.