Hello, new to Grav…have a couple of questions and issues I am trying to resolve.
- Email plugin is not saving the settings I set in Admin. I had to manually configure email.yaml. Not a big deal but was wondering if I missed something. Any ideas as to why this would be happening or am I misunderstanding how the admin UI works?
- Contact Form on my site is not working properly with email. Everything seems to be configured properly, email test works from cli, but the form seems to not follow the settings in email.yaml for authentication to my SMTP server. In email.log, it shows it is trying PLAIN auth type instead of tls. Why is this happening and how can I make sure it follows the configuration set?
Here are the files in question:
email.yaml
enabled: true
from: 'biz-inquiry@*******'
to: 'biz-inquiry@*******'
mailer:
engine: smtp
smtp:
server: 'smtp.protonmail.ch'
port: 587
encryption: tls
user: 'biz-inquiry@*******'
password: '***************'
sendmail:
bin: '/usr/sbin/sendmail -bs'
content_type: text/html
debug: true
Contact Form:
title: 'Contact Me'
subtitle: 'Find out more information'
section_classes: 'bg-gray-100 dark:bg-gray-800 py-8 md:py-24'
title_text: auto
form:
name: contact
action: '#contact-us'
inline_errors: true
fields:
name:
label: Name
display_label: false
placeholder: 'Your full name'
autocomplete: 'on'
type: text
validate:
required: true
email:
label: Email
display_label: false
placeholder: 'Your email address'
type: email
validate:
required: true
phone:
label: Phone
display_label: false
placeholder: 'Your phone number (optional)'
type: text
message:
label: Message
display_label: false
placeholder: 'Your message'
type: textarea
rows: 4
validate:
required: true
buttons:
submit:
type: submit
classes: 'no-default-style text-white bg-gray-700 hover:bg-primary'
value: 'Submit Form'
process:
email:
from: '{{ config.plugins.email.from }}'
to:
- '{{ config.plugins.email.to }}'
- '{{ form.value.email }}'
subject: '[Contact Form] {{ form.value.name|e }}'
body: '{% include ''forms/data.html.twig'' %}'
save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
message: '<b>Thanks!</b> We''ve received your enquiry and will get back to you very soon...'
reset: true
email.log (when submitting contact form):
[2023-10-24 21:27:15] email.INFO: Email sent to [“biz-inquiry@","youseenothing@”] at 2023-10-24 21:27:15 → Failed to authenticate on SMTP server with username “biz-inquiry@********” using the following authenticators: “PLAIN”. Authenticator “PLAIN” returned “Expected response code “235” but got code “535”, with message “535 5.7.8 Error: authentication failed: authentication failed”.”.
email.log (when using email test from cli):
[2023-10-24 20:45:11] email.INFO: Email sent to ["kf5u@"] at 2023-10-24 20:45:11 → < 220 mailsub003.protonmail.ch ESMTP Postfix > EHLO [127.0.0.1] < 250-mailsub003.protonmail.ch < 250-PIPELINING < 250-SIZE 36480000 < 250-STARTTLS < 250-ENHANCEDSTATUSCODES < 250-8BITMIME < 250 CHUNKING > STARTTLS < 220 2.0.0 Ready to start TLS > EHLO [127.0.0.1] < 250-mailsub003.protonmail.ch < 250-PIPELINING < 250-SIZE 36480000 < 250-AUTH PLAIN < 250-ENHANCEDSTATUSCODES < 250-8BITMIME < 250 CHUNKING > AUTH PLAIN Yml6LWlucXVpcnlAa2Y1dS5uZXQAYml6LWlucXVpcnlAa2Y1dS5uZXQATkhZNFk5VldGRjVDSDc2Rg== < 235 2.7.0 Authentication successful > MAIL FROM:<biz-inquiry@> < 250 2.1.0 Ok > RCPT TO:<kf5u@******> < 250 2.1.5 Ok > DATA < 354 End data with . > . < 250 2.0.0 Ok: queued as 4SFWvn6HrKz7QTXW
Here is the output from running the email test from the cli:
Current Configuration:
^ Grav\Common\Data\Data^ {#253
#gettersVariable: "items"
#items: array:6 [
"enabled" => true
"from" => "biz-inquiry@*******"
"to" => "biz-inquiry@*******"
"mailer" => array:3 [
"engine" => "smtp"
"smtp" => array:5 [
"server" => "smtp.protonmail.ch"
"port" => 587
"encryption" => "tls"
"user" => "biz-inquiry@*******"
"password" => "**************6F"
]
"sendmail" => array:1 [
"bin" => "/usr/sbin/sendmail -bs"
]
]
"content_type" => "text/html"
"debug" => true
]
#blueprints: null
#storage: null
-missingValuesAsNull: false
-keepEmptyValues: true
#nestedSeparator: "."
}
Message sent successfully!
Any help or guidance would be greatly appreciated. Also, FWIW, I am using the Typhoon theme and Grav v1.7.43 - Admin v1.10.43. Thanks in advance for your time and help!