gpt4 book ai didi

java - 在 Anypoint Studio (MuleSoft) 中发送电子邮件时出错

转载 作者:太空宇宙 更新时间:2023-11-04 10:48:15 24 4
gpt4 key购买 nike

每次我尝试在 AnyPoint Studio 中发送电子邮件时,都会收到错误消息。我尝试过从其他计算机发送它,它总是有效。它似乎对我不起作用,我不知道为什么。

这是我的 .xml:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<smtp:gmail-connector name="Gmail" validateConnections="true" doc:name="Gmail"/>
<flow name="attemptsendemailFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/sendemail" doc:name="HTTP"/>
<set-payload value="Hello" doc:name="Set Payload"/>
<smtp:outbound-endpoint host="smtp.gmail.com" user="myemail@gmail.com" password="mypwd" connector-ref="Gmail" to="myemail@gmail.com" from="myemail@gmail.com" subject="This is a test." responseTimeout="10000" doc:name="SMTP"/>
</flow>
</mule>

当我打开浏览器并输入 localhost:8081/sendemail 时,不会发送电子邮件,浏览器会打印此消息。

Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=smtp://myemail%40gmail.com:<password>@smtp.gmail.com, connector=GmailSmtpConnector
{
name=Gmail
lifecycle=start
this=17e9bc9e
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[smtp]
serviceOverrides=<none>
}
, name='endpoint.smtp.myemail.gmail.com', mep=ONE_WAY, properties={fromAddress=myemail@gmail.com, toAddresses=myemail@gmail.com, subject=This is a test.}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}.

有趣的是,我在其他计算机上测试了完全相同的 xml 并且它有效。

最佳答案

我会首先测试您的计算机是否可以连接到 Gmail 服务器。

尝试“telnet smtp.gmail.com 587”或 Mac 等效项。

关于java - 在 Anypoint Studio (MuleSoft) 中发送电子邮件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48141557/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com