Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

When using WebSmtpSendData SilkPerformer sends the data without waiting for a response and the mail server closes the connection, why?

When using WebSmtpSendData SilkPerformer sends the data without waiting for a response and the mail server closes the connection, why?

When using WebSmtpSendData SilkPerformer sends the data without waiting for a response - the mail server then gets confused.
This SMTP example shows mail sent by DemoSender at host Sender_Host,
to DemoRec at host Rec_Host.

 

S: MAIL FROM:
R: 250 OK

S: RCPT TO:
R: 250 OK

S: DATA
R: 354 Start mail input; end with .
S: Blah blah blah...
S: ...etc. etc. etc.
S: .
R: 250 OK

SilkPerformer starts the mail message (MAIL FROM, RCPT TO, DATA), but doesn't correctly terminate the message before transmitting the next message.
As a result you get part of the next message appended to the previous one as shown in the following example:

S: MAIL FROM:
R: 250 OK

S: RCPT TO:
R: 250 OK

S: DATA
R: 354 Start mail input; end with .
S: Blah blah blah...
S: ...etc. etc. etc.
S: . //Problem occurs now as more data is sent
S: MAIL FROM: //before the server sends a response
S: RCPT TO:
S: DATA
R: 354 Start mail input; end with .
R: 250 OK

This causes the server to get confused and a timeout can occurs as SilkPerformer is waiting on a server response and the server is waiting on more data being sent.

 

You need to add a WebSmtpResponse function in your script after the termination of your message body
WebSmtpSendData(hSmtp, "\r\n.\r\n");
WebSmtpResponse(hSmtp, sResponse, nMaxResponse)

This will then enable SilkPerformer to wait for the server response 250 OK before sending the next message.
This should stop the messages being sent out of synchronisation and should stop the server timing out.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:03
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.