Emailing In Progress

Hi All, hope you are doing well !!!

I want to implement mailing in progress by using user interface screen (progress GUI) and with batch process as well. Neither I want to use outlook object nor UNIX utilities (like sendmail for this). I think for achieving this requirement I can use progress sockets (please suggest) with SMTP protocol. I have found and used one of the related knowledge base article “Sample Code to Send Email via Internet SMTP with 4GL Sockets” (Please refer below link regarding the same)but I am unable to send email by using mentioned program.

http://knowledgebase.progress.com/articles/Article/19647

Under this program, I am successfully connected with server as I have updated variable vSmtpServer with valid server name and port number and received “Yes” in vstatus variable(please refer below code for this).
Code:
[/B][/B]
[B][B]vstatus = hSocket:CONNECT("-S 465 -H " + vSmtpServer) NO-ERROR.  [/B][/B]
[B][B]

As per my understating, this programs is only for receiving email because various getter methods are available under this program like: GET-BYTES-AVAILABLE.


Please suggest.

Regards,
Rajat.
 
Last edited:
Thanks RHD, shared link was really helpful for me.

As of now, I understood the working of “readhandler” method and SMTP commands used under this this method (referred shared SMTP example).

Under SET-READ-RESPONSE-PROCEDURE method (mentioned below) we are specifying that Readhandler should get called whenever READ-RESPONSE event occurs.

Code:
hSocket:SET-READ-RESPONSE-PROCEDURE("readHandler", THIS-PROCEDURE).


I was expecting that internal procedure “readhandler” should get called whenever “WAIT-FOR READ-RESPONSE (code mentioned below) OF hSocket” occur. Readhandler (IP) isn’t getting called under this program ever, perhaps read-response doesn’t have any data to read/write from socket hSocket (please suggest).


Code:
Vstate = 1.
REPEAT ON STOP UNDO, LEAVE ON QUIT UNDO, LEAVE:
  IF vstate < 0 OR vstate = 7 THEN
  LEAVE.
  WAIT-FOR READ-RESPONSE OF hSocket.
END.


I think, if readhandler gets invoked on “WAIT-FOR READ-RESPONSE OF hSocket” then I am able to send mail by using this program.

Please suggest.

Thanks Rob for your response on this!!

I did not check smtpmail.p yet. As you said, currently this link is not working. I will check again and try to resolve my questions/concern.

Regards,
Rajat.
 
Last edited:
Top