I had problems implementing this in the past. I did some research and found my mail server supports the 'ESMTP' protocol. I looked over the ESMTP RCC docs and modified the above to work with my mail server/support the ESMTP protocol to a certain extent.
Oddly enough, the only thing preventing the above example from supporting 'basic' ESMTP is an 'EHLO' (yes, 'EHLO') command.
With that said, using a web-based solution is probably the best idea. With all of these obscure mail protocols floating around there's no telling what type Player A's mail server supports.
Oh, and for the curious soul, here's my modified example:
;ESMTP Protocol Test
;Notes on the ESMTP Protocol:
;-To see a list of features the server supports, send the server a "HELP" command
;-Each server message is prefixed with a 3 digit code. Certain codes represent error messages, etc.
;and can be parsed to determine the error.
;-Common error codes Include:
;421 -> SMTP server no longer available
;500 -> 'EHLO' command is not supported (server doesn't support ESMTP)
;501 -> 'EHLO' arguement not acceptable
;502 -> Server unnable to implement 'EHLO' command
;504 -> Unknown error
streamin = OpenTCPStream(Input("Enter SMTP Server: " ), 25) ;assumed port 25 (standard port)
If Not streamin
RuntimeError("Server not found.")
EndIf
mailFrom$ = Input("Enter From Address: ")
mailTo$ = Input("Enter To Address: ")
message$ = Input("Enter Mail Message (\n for new line): ")
message$ = Replace$(message$, "\n", Chr$(13)+Chr(10))
If streamin
WriteLine streamin, "EHLO ESMTPTest" ;seems to be the only thing separating SMTP from being ESMTP on the client side
DebugLog ReadLine(streamin) ;should acknowledge 'EHLO' (what an odd greeting..)
WriteLine streamin, "HELO ESMTPTest"
WriteLine streamin, "MAIL FROM:<" + Trim$(mailFrom$) + ">"
DebugLog ReadLine(streamin)
WriteLine streamin, "RCPT TO:<" + Trim$(mailTo$) + ">"
DebugLog ReadLine(streamin)
WriteLine streamin, "DATA"
DebugLog ReadLine(streamin)
WriteLine streamin, message$
WriteLine streamin, " "
WriteLine streamin, "."
WriteLine streamin, "QUIT"
DebugLog ReadLine(streamin)
CloseTCPStream(streamin)
EndIf
WaitKey()