• having some problems with

    From Kernal2@VERT/CHATFREE to All on Tue Aug 21 15:20:00 2001
    I am having some problems with this program. Its not sending out the emailãmessage. Can you please tell me whats wrong with it??ãã# Put all the Dim Statements hereãint minsec maxsec newsec maxtry count1 count2 sockãstr floc info1 fn fp tp1 ea sn sp mailfrom mailto cea yourdomainãset tp1 ""ãset fn ""ãset floc ""ãset fp ""ãset cea ="0"ãset maxtry "0"ãset count1 "0"ãset count2 "0"ãset str ""ãfopen file1 O_RDONLY "c:\sbbs\exec\qtv.cfg"ãfread_line file1 flocãfread_line file1 minsecãfread_line file1 maxsecãfread_line file1 newsec ãfread_line file1 yourdomainãfread_line file1 snãfread_line file1 spãfread_line file1 mailfromãfread_line file1 ceaãfread_line file1 maxtryãfclose file1ãtruncsp flocãtruncsp minsecãtruncsp maxsecãtruncsp newsecãtruncsp yourdomainãtruncsp snãtruncsp spãtruncsp mailfromãtruncsp ceaãtruncsp maxtryã# Create a connection with the server.ããsocket_open sockãsocket_connect sock sn spãif_falseãprint "Connection failed.\r\n"ãpauseãgoto endãend_ifãã# Intial dialupãset mailto "ptaylor10@cox.rr.com"ããsprintf str "helo %s\n" yourdomainã#sprintf str "%s\n" yourdomainãsocket_write sock strããsprintf str "mail from: %s\n" mailfromãsocket_write sock strããsprintf str "rcpt to: %s\n" mailtoãsocket_write sock strããset str "data\n"ãsocket_write sock strãã# Send additional headers like subject, date ect..ããset str "Subject: Your password\n"ãsocket_write sock strããsprintf str "To: %s\n\n" mailtoãsocket_write sock strãã# Send body of the message.ããset str "\n"ãsocket_write sock strãã#set str "The wick brown box\n"ãprintf str "This is a test\n"ãsocket_write sock strãã# Terminate body of message, close connection with serverãããThank youãTerminatorããã---ã þ Synchronet þ Synchronet -> Chatfree BBS bbs.chatfree.orgã
  • From Amcleod@VERT to Kernal2 on Tue Aug 21 23:03:17 2001
    RE: having some problems withãBY: Kernal2 to All on Tue Aug 21 2001 10:20 pmãã > I am having some problems with this program. Its not sending out the emailã > message. Can you please tell me whats wrong with it??ããWell, just having a quick look at it, I note that you are putting TWO blankãlines between the additional headers and the body, one as an extra \n after theã"To:" address, and then one as a separate \n before the body goes out. Butãthis won't cause it to fail -- just to add a blank line at the top of the body.ããAlso, I note that the tail end of the program that closes the dialogue with theãserver is absent. Is it really missing, or just not included in the message? ãAfter the body is sent you need to send a "\n.\n" (newlinw-dot-newline) to markãthe end of the body, and then a "quit" to sever the connection with the serverã(unless you want to loop back and send another message).ããif all that looks good, then I'd suggest sticking in a few lines to grab andãdisplay the response from the server so you can see what's wrong. Right afterãeach "SOCKET_WRITE" try adding aãã SOCKET_READLINE sock strã PRINT strããand then run it while you watch (like ;EXEC *MODULE). You should see theãresponses from the server. There will be some garbage there too, but theãplain-text response will also be visible after the garbage. (Anybody know whatãthis garbage is and how to suppress/bypass it?) The responses from the serverãshould let you know what is happening. You may need a PAUSE at the end so itãdoesn't disappear in a flash...ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Digital Man@VERT to Kernal2 on Wed Aug 22 09:38:19 2001
    RE: having some problems withãBY: Kernal2 to All on Tue Aug 21 2001 10:20 pmãã > #set str "The wick brown box\n"ã > printf str "This is a test\n"ã > socket_write sock strãã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 theseãwere obvious to me.ãã-Robã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Kernal3@VERT to Digital Man on Wed Aug 22 10:07:35 2001
    RE: having some problems withãBY: Digital Man to Kernal2 on Wed Aug 22 2001 04:38 pmãã > RE: having some problems withã > BY: Kernal2 to All on Tue Aug 21 2001 10:20 pmã > ã > > #set str "The wick brown box\n"ã > > printf str "This is a test\n"ã > > socket_write sock strã > ã > 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 theã > were obvious to me.ã > ã > -RobããI tried that is its not working.ããHere is the code I have now.ãã# Intial dialupãset mailto "ptaylor10@cox.rr.com"ããsprintf str "helo %s\n" yourdomainã#sprintf str "ehlo %s\n" yourdomainãsocket_write sock strãsocket_readline sock strãprint strããsprintf str "mail from: %s\n" mailfromãsocket_write sock strããsprintf str "rcpt to: %s\n" mailtoãsocket_write sock strãããset str "data\n" ãsocket_write sock strãã# Send additional headers like subject, date ect..ããset str "Subject: New password for bbs.chatfree.org\n"ãsocket_write sock strããsprintf str "To: %s\n\n" mailtoãsocket_write sock strããã# Send body of the message.ããset str "\n"ãsocket_write sock strãã#set str "The wick brown box\n"ã#printf str "This is a test\n"ãsprintf str "Your new password is : %s\r\n" pw1ãsocket_write sock strãã# Terminate body of message, close connection with serverããset str "\r\n" ãsocket_write sock strããset str "quit\r\n"ãsocket_write sock strãsocket_close sockãPrint "Message sent.\r\n"ãããDo know why its not sending the email message to cox.rr.com smtp server. I amãgetting a connection to there server.ããThank youãPhilã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Amcleod@VERT to Kernal3 on Wed Aug 22 13:42:53 2001
    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ã