RE: having some problems withãBY: Kernal3 to Digital Man on Wed Aug 22 2001 05:07 pmãã > > I think you mean sprintf here (not printf). Also, SMTP command should beã > > terminated with "\r\n" (not just "\n"). There may be other problems, but ã > > were obvious to me.ããI used "\n" in my test module and sent myself mail perfectly via the companyãSMTP server (sendmail). Maybe some servers are more tolerant?ãã > sprintf str "helo %s\n" yourdomainã > socket_write sock strã > socket_readline sock strã > print strããYou couldput a SOCKET_READLINE/PRINT after _every_ SOCKET_WRITE so you can seeãwhere the dialogue goes bad. Anyway...ãã > # Terminate body of message, close connection with serverã > set str "\r\n"ã > socket_write sock strã > set str "quit\r\n"ã > socket_close sockããYou are not actually terminating the message, so when you SOCKET_CLOSE theãconnection is reset and the server drops everything you've done so far on theãfloor with a clang.ããAfter you send "data", everything you send is considered part of the messageãuntil you explicitly terminate the message text. You do this by sending a lineãconsisting of a full-stop by itself. IOW "\n.\n" after the message body. Ifãyou don't do this (and your code DOESN'T do this) the "quit" will become justãanother line in the message. Then the SOCKET_CLOSE breaks the connectionã_before_ the message is completed -- so the server discards it. You need toãsend in all:ãã helo domain.comã mail from:
me@domain.comã rcpt to:
user@destination.comã dataã <additional headers andã body of message goes here,ã as many lines as you like>ã .ã quitããYou HAVE to send the dot before the "quit". On a line by itself.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã