Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Address in mailbox given [] does not comply with RFC 2822, 3.6.2

form plugins

Started by Martian 6 years ago · 3 replies · 3103 views
6 years ago

Hi, I am using Grav for the first time today. I know how to deal with HTML, CSS, Javascript and web related stuff. So, I am not a newbie on that part.

I am trying to create a blog where I can create pages that can display: code segments, youtube videos, images, and forms.

I am trying to discover if Grav can do that.

Anyway, I am now trying to create a form. I have managed to create the form as a new page. I have also managed to insert a form on an existing page.

I have to say that this was an herculean task, because the help is written for the expert and has a lot of gaps and missing information, make it indecipherable for the beginner.

Every time I send a form, using a VALID EMAIL, I see this message

Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

and a detailed page that shows paths inside my server that I would not like the user to see.

also, notice that the array [] is empty, what is amazing, because I am filling the email on the form.

This is the code I have added to the form:

YAML
title: Contact
form:
name: contact-form
template: form-messages
refresh_prevention: true
fields:
    -
        name: name
        label: Name
        placeholder: 'Enter your name'
        autofocus: 'on'
        autocomplete: 'on'
        type: text
        validate:
            required: true
    -
        name: email
        label: Email
        placeholder: 'Enter your email address'
        autocomplete: 'on'
        type: email
        validate:
            required: true
    -
        name: message
        label: Message
        type: textarea
        validate:
            required: false
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 for your message. We will answer as soon as possible.'
    -
        display: thankyou

Two questions:

  1. how do I make the form work?
  2. how do I disable this detailed message showing parameters and variables from inside the server?

Thanks

last edited 08/25/20 by Martian
6 years ago

@martian, When the 'email' plugin has not been configured, the error you mentioned will be thrown.

image|418x180

6 years ago

ah, I see... THANKS

I have tried to configure the email plugin and it tells me to configure two fields:

TO and FROM.

TO is easy to understand but FROM is not.

Isn't FROM to be configured on the fly with the email filled by the user when the form is submitted?

6 years ago

You are right. The ‘from’ address in the Email Plugin actually is the system sender or webmaster address.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 54 1 week ago
Plugins · by Xavier, 4 weeks ago
2 61 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1188 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 54 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 79 2 months ago