WARN metabase.email :: 发送邮件失败

定时发送邮件报错:
metabase.email :: 发送邮件失败
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.xxx.com, 465; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.xxx.com

但是单独点击发送邮件没问题

{
"browser-info": {
"language": "zh-CN",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "1.8.0_65-b17",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "http://java.oracle.com/",
"java.version": "1.8.0_65",
"java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
"java.vm.version": "25.65-b01",
"os.name": "Linux",
"os.version": "3.10.0-693.el7.x86_64",
"user.language": "en",
"user.timezone": "Asia/Shanghai"
},
"metabase-info": {
"databases": [
"h2",
"clickhouse",
"mysql"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MySQL",
"version": "5.7.22-log"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.6.2"
}
},
"run-mode": "prod",
"version": {
"tag": "v0.40.1",
"date": "2021-07-14",
"branch": "release-x.40.x",
"hash": "ed8f9c8"
},
"settings": {
"report-timezone": "Asia/Shanghai"
}
}
}

Hi @lingda
Upgrade Java: https://www.metabase.com/docs/latest/operations-guide/java-versions.html
It says that the host is unknown, so check if your DNS is functioning correctly and that no firewall/antivirus is blocking.

hi,
如果是dns或防火墙的问题,为什么单独点击发送邮件可以使用

@lingda I don't know. Upgrade to Java 11.

I upgraded to Oracle java11, but it still doesn’t work

@lingda
Which SMTP provider are you using? Most providers uses port 587 for TLS connections.
Are you using a firewall/antivirus/etc, which might be intercepting the connection between Metabase and the SMTP server, then try disabling those.

I use port 25, we use ExtMail
When the time came, I printed the following, and then there was no response.

2021-08-26 19:00:00,010 INFO task.send-pulses :: 正在发送定时任务报告...

{
"browser-info": {
"language": "zh-CN",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0",
"vendor": ""
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.12+7",
"java.vendor": "Eclipse Foundation",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.12",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.12+7",
"os.name": "Linux",
"os.version": "3.10.0-693.el7.x86_64",
"user.language": "en",
"user.timezone": "Asia/Shanghai"
},
"metabase-info": {
"databases": [
"h2"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2021-07-14",
"tag": "v0.40.1",
"branch": "release-x.40.x",
"hash": "ed8f9c8"
},
"settings": {
"report-timezone": null
}
}
}

We use it on the company's intranet, are there any other hidden ports that need to be opened?

@lingda You first post clearly uses port 465. If you now say that you are using port 25, then that is likely the problem.
Check the logs on your mail server to see if there's any connections made from Metabase.
I have no idea if you actually had any pulses, which was supposed to be sent at 19:00:00, so check the tasks in Admin > Troubleshooting > Tasks

I did not say it clearly
I now deploy another set of two environments, one is port 25 and the other is port 465, but I haven’t received regular emails.

Please help to take a look,This is the third new environment I got
. no mail is received


@lingda I think you need to see if there is someone who can help you in your language.
It is not clear if you can actually send emails, or if it is a timezone problem.
I cannot help you.

Okay, thank you, can you provide information or instructions for subscribing to the dashboard?

@lingda Have a look at the documentation about Dashboard Subscriptions:
https://www.metabase.com/docs/latest/users-guide/dashboard-subscriptions.html

@lingda Metabase supports any SMTP server that follows the standards.
You will have to look at the providers website:
http://help.163.com/09/1223/14/5R7P3QI100753VB8.html

@lingda Yes. But there's a communication barrier between us, so it is too difficult for me to help you. Try asking help in a forum that is in your language.

thank you,I try to it