Has anyone successfully integrated MailHog into UF?


#1

I’m trying to configure UserFrosting to send mail to the MailHog (https://github.com/mailhog) machine I’ve got running on port 1025. I’m having no luck with anything I’ve tried to date. Has anyone tried to do this and how did you succeed?

My custom default.php settings are as follows …
return [
‘address_book’ => [
‘admin’ => [
‘name’ => ‘Frank’
]
],
‘debug’ => [
‘smtp’ => true
],
‘mail’ => [
‘mailer’ => ‘smtp’, // Set to one of ‘smtp’, ‘mail’, ‘qmail’, ‘sendmail’
‘host’ => getenv(‘SMTP_HOST’) ?: null,
‘port’ => 1025,
‘auth’ => false,
‘secure’ => ‘tls’,
‘username’ => getenv(‘SMTP_USER’) ?: null,
‘password’ => getenv(‘SMTP_PASSWORD’) ?: null,
‘smtp_debug’ => 4,
],
…etc

Here is what I see output in the userfrosting.log from my latest effort …
[2018-11-12 11:31:25] mail.DEBUG: Connection: opening to mailhog:1025, timeout=15, options=array (
) [] []
[2018-11-12 11:31:25] mail.DEBUG: Connection: opened [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was “” [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "220 mailhog.example ESMTP MailHog
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "220 mailhog.example ESMTP MailHog
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SERVER -> CLIENT: 220 mailhog.example ESMTP MailHog
[] []
[2018-11-12 11:31:25] mail.DEBUG: CLIENT -> SERVER: EHLO localhost
[] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was “” [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "250-Hello localhost
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "250-Hello localhost
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was "250-Hello localhost
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "250-PIPELINING
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "250-Hello localhost
250-PIPELINING
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was "250-Hello localhost
250-PIPELINING
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "250 AUTH PLAIN
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "250-Hello localhost
250-PIPELINING
250 AUTH PLAIN
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SERVER -> CLIENT: 250-Hello localhost
250-PIPELINING
250 AUTH PLAIN
[] []
[2018-11-12 11:31:25] mail.DEBUG: CLIENT -> SERVER: STARTTLS
[] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was “” [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "500 Unrecognised command
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "500 Unrecognised command
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SERVER -> CLIENT: 500 Unrecognised command
[] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP ERROR: STARTTLS command failed: 500 Unrecognised command
[] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP Error: Could not connect to SMTP host. [] []
[2018-11-12 11:31:25] mail.DEBUG: CLIENT -> SERVER: QUIT
[] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data was “” [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $str is "221 Bye
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP -> get_lines(): $data is "221 Bye
" [] []
[2018-11-12 11:31:25] mail.DEBUG: SERVER -> CLIENT: 221 Bye
[] []
[2018-11-12 11:31:25] mail.DEBUG: Connection: closed [] []
[2018-11-12 11:31:25] mail.DEBUG: SMTP Error: Could not connect to SMTP host. [] []