Can't send mail with $mail.send method in Azure

Airis TestUser5 1 Reputation point
2022-11-09T14:46:37.743+00:00

According to the logs, we cannot establish a connection with the host. For some reason the host is blocking the connection.
So we suggest that it's necessary to contact the host administrator and check the correctness of the port settings. Could you please check our host settings?

Now we have the error:

Unable send email for request MailRequest    
com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [GV3P280CA0083.SWEP280.PROD.OUTLOOK.COM]      
      
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2373)       
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1808)       
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1285)       
at com.justai.zb.jsapi.mail.MailService.lambda$send$1(MailService.java:52)       
at com.justai.zb.jsapi.mail.MailService.sendWithTimeCheck(MailService.java:159)       
at com.justai.zb.jsapi.mail.MailService.send(MailService.java:52)       
at com.justai.zb.jsapi.mail.MailServiceJSAdapter.send(MailServiceJSAdapter.java:34)       
at jdk.nashorn.internal.scripts.Script$60817$mail.$mail#sendInternal(/jsapi/mail.js:74)       
at jdk.nashorn.internal.scripts.Script$60817$mail.$mail#send(/jsapi/mail.js:66)       
at jdk.nashorn.internal.scripts.Script$60825$generated$cu98.script__src_themes_veeva_sc_224_33(/var/lib/justai/botserver/bots/3thtEuJo5s1fBxhZPoBK5z/1000034616-testirovanie_v_teams-1000034616-FjL-20939971500/1000034616-testirovanie_v_teams-1000034616-FjL-20939971500/420/generated.js:20131)       
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639)       
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)       
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)       
at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199)       
at com.justai.zb.scenarios.engine.ScriptingEngine.lambda$executeScript$2(ScriptingEngine.java:157)       
at com.justai.zb.scenarios.engine.ScriptingEngine.executeJS(ScriptingEngine.java:143)       
at com.justai.zb.scenarios.engine.SandboxScriptingEngine.lambda$executeJS$0(SandboxScriptingEngine.java:93)       
at com.justai.zb.scenarios.engine.sandbox.JsEvaluator.run(JsEvaluator.java:89)       
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)       
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)       
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)       
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)      

or these type:

Unable send email for request MailRequest     
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: XXX, X; timeout -1       
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2209)       
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:722)       
at javax.mail.Service.connect(Service.java:342)       
at com.justai.zb.jsapi.mail.MailService.createTransportAndConnect(MailService.java:112)       
at com.justai.zb.jsapi.mail.MailService.lambda$send$0(MailService.java:49)       
at com.justai.zb.jsapi.mail.MailService.connectWithTimeCheck(MailService.java:141)       
at com.justai.zb.jsapi.mail.MailService.send(MailService.java:48)       
at com.justai.zb.jsapi.mail.MailServiceJSAdapter.send(MailServiceJSAdapter.java:34)       
at jdk.nashorn.internal.scripts.Script$65610$mail.$mail#sendInternal(/jsapi/mail.js:74)       
at jdk.nashorn.internal.scripts.Script$65610$mail.$mail#send(/jsapi/mail.js:66)       
at jdk.nashorn.internal.scripts.Script$65618$generated$cu98.script__src_themes_veeva_sc_140_17(/var/lib/justai/botserver/bots/3thtEuJo5s1fBxhZPoBK5z/1000034616-testirovanie_v_teams-1000034616-FjL-20939971500/1000034616-testirovanie_v_teams-1000034616-FjL-20939971500/450/generated.js:20082)       
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639)       
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)       
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)       
at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199)       
at com.justai.zb.scenarios.engine.ScriptingEngine.lambda$executeScript$2(ScriptingEngine.java:157)       
at com.justai.zb.scenarios.engine.ScriptingEngine.executeJS(ScriptingEngine.java:143)       
at com.justai.zb.scenarios.engine.SandboxScriptingEngine.lambda$executeJS$0(SandboxScriptingEngine.java:93)       
at com.justai.zb.scenarios.engine.sandbox.JsEvaluator.run(JsEvaluator.java:89)       
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)       
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)       
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)       
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)       
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)       
Caused by: java.net.UnknownHostException: XXX  
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)       
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)       
at java.net.Socket.connect(Socket.java:607)       
at java.net.Socket.connect(Socket.java:556)       
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:335)       
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:214)       
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2160)       
... 23 common frames omitted      

{ "status": "UNABLE_TO_CONNECT" }      

Thanks in advance!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,126 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,189 questions
{count} votes