-1

I am getting test emails but not contact form email?

{% macro errorList(errors) %}
    {% if errors %}
        {{ ul(errors, {class: 'errors'}) }}
    {% endif %}
{% endmacro %}

{% set message = message ?? null %}

<form method="post" action="" accept-charset="UTF-8">
    {{ csrfInput() }}
    {{ actionInput('contact-form/send') }}
    {{ redirectInput('contact/thanks') }}

    <h3><label for="from-name">Your Name</label></h3>
    {{ input('text', 'fromName', message.fromName ?? '', {
        id: 'from-name',
        autocomplete: 'name',
    }) }}
    {{ message ? _self.errorList(message.getErrors('fromName')) }}

    <h3><label for="from-email">Your Email</label></h3>
    {{ input('email', 'fromEmail', message.fromEmail ?? '', {
        id: 'from-email',
        autocomplete: 'email',
    }) }}
    {{ message ? _self.errorList(message.getErrors('fromEmail')) }}

    <h3><label for="subject">Subject</label></h3>
    {{ input('text', 'subject', message.subject ?? '', {
        id: 'subject',
    }) }}
    {{ message ? _self.errorList(message.getErrors('subject')) }}

    <h3><label for="message">Message</label></h3>
    {{ tag('textarea', {
        text: message.message ?? '',
        id: 'message',
        name: 'message',
        rows: 10,
        cols: 40,
    }) }}
    {{ message ? _self.errorList(message.getErrors('message')) }}

    <button type="submit" class="primary btn">Send</button>
</form>
6
  • 1
    Please provide more information: What's the context of this code? What errors are you getting? What have you tried to solve this? Also, what do you mean by "Contact Form 7", the WordPress plugin? Please clean up your code example as well. As it stands, this question is unanswerable, so I'm voting to close this.
    – MoritzLost
    Aug 10, 2021 at 15:03
  • Does the error handling work properly (eg leaving fields blank, etc.) Are you using any other plugins that modify the default contact form behavior? (eg contact form extensions, honeypot, etc.) Aug 11, 2021 at 14:21
  • 1
    You may also want to consider adding a flash notice to rule out any other errors. Aug 11, 2021 at 14:26
  • Not Wordpress Plugin i am using craft contact form plugin and i am not getting any kind of error even in logs as well. @MoritzLost
    – DTS
    Aug 12, 2021 at 5:38
  • 1
    @namita Have you set a recipient (toEmail) in the config file? github.com/craftcms/contact-form#overriding-plugin-settings
    – MoritzLost
    Aug 12, 2021 at 7:54

1 Answer 1

0

Please check the attached screenshot.

enter image description here

In your craft cms Admin panel Go to Settings -> Email as shown in the above screenshot. Please check that you have filled in all the detail in the email settings form. Also if you are using the SMTP as a transport type then you need to check the same SMTP is working with PHP code or not.

You can check the test email using the "Test" button at the bottom of the email setting page.

If nothing works for you then let me know more details so we can help.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.