So I need again your help guys. I’m building for the first time a contact form but despite my efforts, nothing.
The structure is the same, page “Contacts” with modular.md
modular.md
title: Contacts
cache_enable: false
form:
name: contact-form
action: /contacts
fields:
- name: form-name
label: Name
placeholder: Name
autocomplete: on
type: text
validate:
required: true
Inside _contact sub-folder there is a form.md and form.html.twig has {% include ‘forms/form.html.twig’ %}
So the form is loaded perfectly but when I submit it, I got this error:
Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
Email-Plugin is setted as SMTP with Mailtrap.io account, one personal email for “from” and “to”, and I used different emails for submit test.
Everything is update.
I don’t get what is going wrong, do you have any ideas?
I’m getting this same error.
I set up a form a week or so ago with no issue. I’m revisiting it make changes to the fields. Whenever I make a change and test the form, I get this error.
YAML
---
title: New Art
access:
site.login: true
admin.login: true
visible: false
form:
name: contact-form
fields:
- name: customer
label: Customer
placeholder: Enter customer name
autofocus: on
autocomplete: on
type: text
validate:
required: true
- name: contact
label: Contact
placeholder: Enter contact name
type: text
validate:
required: true
- name: phone
label: Contact Phone Number
placeholder: Enter contact phone number
type: text
validate:
required: true
- name: email
label: Email
placeholder: Enter contact email address
type: email
validate:
required: true
- name: datein
label: Date In
placeholder: Enter date new job is created
type: date
validate:
required: true
- name: designdue
label: Design Due Date
placeholder: Enter due date for design
type: date
validate:
required: true
- name: inhands
label: In Hands
placeholder: Enter date customer wants product in hands
type: date
validate:
required: true
- name: product
label: Product
placeholder: Enter product name and number (A link to product blank is best)
type: text
validate:
required: true
- name: description
label: Description
placeholder: Enter any additional helpful information
type: textarea
validate:
required: true
buttons:
- type: submit
value: Submit
- type: reset
value: Reset
process:
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.to }}"
- "{{ form.value.email }}"
subject: "[Feedback] {{ 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: Thank you for your feedback!
- display: thankyou
---
The form works as it is above. Small changes will throw an error though. For instance:
If I change validate.required to false on email, I get the error. I can change validate.required to false on the other fields with no problem.
If I change type to text instead of email, I get the error.
If I remove any of the list items under fields, I get the error.
I can delete all fields except for email and it works. If I change the name of the field from email to something else, it then gives that error again. Have I somehow broken something by giving the field name: email ?
It makes no sense to me why these small changes would create this error. Any insight would be appreciated!