>>>250 comcast.net
>>>530 Authentication required
>>>
>>>>>>500 Command unrecognized
>>>
>>>>>>#INCLUDE winsockdemo.h >>> >>>LOCAL nPauseCounter, cRetVal, cUserName, cPassword, cServerName >>>LOCAL cUserName, cPassword, cSender, cRecipient, cSubject, cMsgBody >>>nPauseCounter = 0 >>> >>> >>>DECLARE Sleep ; >>> IN Win32API; >>> INTEGER nMilliSeconds >>> >>> >>>WITH ThisForm >>> >>> ** Clear the status box and the log >>> .txtStatus.Value = "" >>> .edtLog.Value = "" >>> >>> ** Get values from the form >>> cServerName = ALLTRIM(.txtServerName.Value) >>> cUserName = ALLTRIM(.txtUserName.Value) >>> cPassword = ALLTRIM(.txtPassword.Value) >>> cSender = "<" + ALLTRIM(.txtFromAddress.Value) + ">" >>> cRecipient = "<" + ALLTRIM(.txtToAddress.Value) + ">" >>> cSubject = ALLTRIM(.txtSubject.Value) >>> cMsgBody = ALLTRIM(.edtBodyText.Value) >>> >>> ** Set up the winsock control >>> .oWinSock.Protocol = PROTCOL_TCP >>> .oWinsock.RemoteHost = cServerName >>> .oWinsock.LocalPort = LOCAL_PORT >>> .oWinsock.RemotePort = REMOTE_PORT >>> >>> ** Attempt to connect >>> .oWinsock.Object.Connect() >>> >>> ** Pause for half a second >>> =Sleep(nSleepDelay) >>> >>> ** Display a message >>> .edtLog.Value = .edtLog.Value + "Waiting for socket to be connected.." + CRLF >>> >>> ** If not connected, pause while a connection is attempted >>> DO WHILE .oWinsock.State # sckConnected AND nPauseCounter <= 10 >>> =INKEY(.5) >>> nPauseCounter = nPauseCounter + 1 >>> ENDDO >>> >>> ** If the socket is connected... >>> IF .oWinsock.State = sckConnected >>> >>> ** Initiate connection and login to the mail server >>> cRetVal = .SendSMTPData("HELO kevin@marois-consulting.com") >>> cRetVal = .SendSMTPData("MAIL FROM:" + cSender) && <========== >>> cRetVal = .SendSMTPData("USER:" + cUserName) >>> cRetVal = .SendSMTPData("PASS:" + cPassword) >>> cRetVal = .SendSMTPData("RCPT TO:" + cRecipient) >>> cRetVal = .SendSMTPData("DATA") >>> >>> ** Format the mail message >>> cRetVal = .SendSMTPData("From:" + + ALLTRIM(.txtFromAddress.Value), TRUE) >>> cRetVal = .SendSMTPData("To:" + ALLTRIM(.txtToaddress.Value), TRUE) >>> cRetVal = .SendSMTPData("Subject: " + cSubject, TRUE) >>> cRetVal = .SendSMTPData("", TRUE) >>> cRetVal = .SendSMTPData(cMsgBody, TRUE) >>> cRetVal = .SendSMTPData(".", TRUE) >>> >>> ** Finish the connection >>> cRetVal = .SendSMTPData("QUIT") >>> >>> ELSE >>> .edtLog.Value = .edtLog.Value + "Unable to send mail Socket State " + STR(.oWinsock.State,2) + CRLF >>> .edtLog.Refresh >>> ENDIF >>> >>>ENDWITH >>> >>>CLEAR DLLS >>> >>>RETURN >>>