Unable to create smtp

Hi,

How can i set up SMTP for metabase?

I tried all different security methods but all return with the error, Read Timed Out.

Tried disabling firewall and antivirus, same error.

Tested telnet to SMTP on the server hosting metabase, it works.

Hi @zhenghao
Which SMTP provider are you using?
Post "Diagnostic Info" from Admin > Troubleshooting.
And post the full stacktrace error from Admin > Troubleshooting > Logs.

Hi,

Running on a cPanel hosted SMTP.

Please see diagnostics below.

Tested with upgrading it to the latest version of JRE, the results is the same so I believe its not due to java version.

{
   "browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) 
 Chrome/102.0.0.0 Safari/537.36",
"vendor": "Google Inc."
  },
  "system-info": {
"file.encoding": "Cp1252",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "1.8.0_333-b02",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "http://java.oracle.com/",
"java.version": "1.8.0_333",
"java.vm.name": "Java HotSpot(TM) Client VM",
"java.vm.version": "25.333-b02",
"os.name": "Windows Server 2012 R2",
"os.version": "6.3",
"user.language": "en",
"user.timezone": "Asia/Singapore"
  },
 "metabase-info": {
"databases": [
  "h2",
  "sqlserver"
],
"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": {
  "tag": "v0.43.3",
  "date": "2022-06-13",
  "branch": "release-x.43.x",
  "hash": "c9c7ef0"
},
"settings": {
  "report-timezone": "Asia/Singapore"
}
}
}

Unable to retrieve the fullstack log, loaded for too long to see any data out of it.

This is the error from the console.
2022-06-24 08:58:34,389 WARN api.email :: Problem connecting to mail server: Exception reading response: Read timed out 2022-06-24 08:58:34,399 DEBUG middleware.log :: PUT /api/email 400 17.8 s (1 DB calls) {:message "Sorry, something went wrong. Please try again. Error: Exception reading response: Read timed out"}

@zhenghao

  1. Upgrade to Java 11:
    https://www.metabase.com/docs/latest/operations-guide/java-versions.html
  2. Migrate away from H2 if you are using Metabase in production:
    https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
  3. Make sure that no antivirus/firewall are blocking the Metabase process (java) from connecting.

Hi,

  1. I tried with this, the result is the same
  2. Understand on this but we are now evaluating the product, will do it once we go into production
  3. Disable both antivirus and firewall, result is the same.

@zhenghao Okay, try another SMTP server then. Seems like it's the same error as Office365:
https://github.com/metabase/metabase/issues/19662