Starting a couple of days ago I have been seeing emails failing to send intermittently. It only happens on the Web Application Server. No problems in working preview or from a browser logged into the development server.
When it started I was on build Build 5647_5251. Yesterday I installed build 5685_5259. Both WAS and development server are on the same build.
It appears that email_smtp_open() is failing. But there is no error. I have tested in Chrome and Edge using two different smtp email servers - Amazon and SendGrid. Same results with any of them.
I have some code to test it that returns the values in ps.s, along with a results of email_smtp_open, email_smtp_send, and email_smtp_close.
Here is one result:
03:25 PM
SendGrid
Canceled: False
Code: 0
Error: False
NativeCode: 0
NativeText:
RowsAffected: 0
StackTrace:
Success: True
Text: Success
TextAndStackTrace:
SMTP Open Failed
SMTP Send Failed
SMTP Close Failed
The strange thing is that sometimes it works, then it will stop working.
Here is the code I am using to test:
When it started I was on build Build 5647_5251. Yesterday I installed build 5685_5259. Both WAS and development server are on the same build.
It appears that email_smtp_open() is failing. But there is no error. I have tested in Chrome and Edge using two different smtp email servers - Amazon and SendGrid. Same results with any of them.
I have some code to test it that returns the values in ps.s, along with a results of email_smtp_open, email_smtp_send, and email_smtp_close.
Here is one result:
03:25 PM
SendGrid
Canceled: False
Code: 0
Error: False
NativeCode: 0
NativeText:
RowsAffected: 0
StackTrace:
Success: True
Text: Success
TextAndStackTrace:
SMTP Open Failed
SMTP Send Failed
SMTP Close Failed
The strange thing is that sometimes it works, then it will stop working.
Here is the code I am using to test:
Code:
function sendsmtp_open as c (e as p) dim js as c = "" dim pm as P dim ps as P dim msg as c dim sendby as c = "Amazon" ' "SendGrid" dim _time as c = a5_timestamp() if sendby = "Amazon" then dim smtpOpen as L = email_smtp_open(ps, "email-smtp.us-east-1.amazonaws.com", 465, "username", "password", "SSL") dim _body as c = _time + "<br><br>" + "Amazon" msg = "Amazon" + crlf(2) else if sendby = "SendGrid" dim smtpOpen as L = email_smtp_open(ps, "smtp.sendgrid.net", 587, "username", "password", "TLS") dim _body as c = _time + "<br><br>" + "SendGrid" msg = "SendGrid" + crlf(2) end if msg = msg + "Canceled: " + ps.s.CallResult.Canceled + crlf() msg = msg + "Code: " + ps.s.CallResult.Code + crlf() msg = msg + "Error: " + ps.s.CallResult.Error + crlf() msg = msg + "NativeCode: " + ps.s.CallResult.NativeCode + crlf() msg = msg + "NativeText: " + ps.s.CallResult.NativeText + crlf() msg = msg + "RowsAffected: " + ps.s.CallResult.RowsAffected + crlf() msg = msg + "StackTrace: " + ps.s.CallResult.StackTrace + crlf() msg = msg + "Success: " + ps.s.CallResult.Success + crlf() msg = msg + "Text: " + ps.s.CallResult.Text + crlf() msg = msg + "TextAndStackTrace: " + ps.s.CallResult.TextAndStackTrace + crlf() dim msgtxtx as c = msg 'debug(1) if smtpOpen = .f. then msg = "SMTP Open Failed" else if smtpOpen = .t. then msg = "SMTP Open Succeeded" end if pm.to = '[email protected]" pm.from = "'[email protected]" pm.subject = "Test Email" pm.html_message = _body dim smtpSend as L = email_smtp_send(pm, ps) if smtpSend = .f. then msg = msg + crlf() + "SMTP Send Failed" else if smtpSend = .t. then msg = msg + crlf() + "SMTP Send Succeeded" end if dim smtpClose as l = email_smtp_close(ps) if smtpClose = .f. then msg = msg + crlf() + "SMTP Close Failed" else if smtpClose = .t. then msg = msg + crlf() + "SMTP Close Succeeded" end if js = "{dialog.Object}.setValue('Msgtext','" + js_escape(_time) + "' + '\n\n' + '" + js_escape(msgtxtx) + "' + '\n' + '" + js_escape(msg) + "');" endSendsmtp_open: sendsmtp_open = js end function
Comment