Forum

Thread tagged as: Problem, Configuration, Forms

Emails not sending from Contact Form

Hi,

I'm having trouble where my contact form has stopped sending emails of responses.

I have checked my 'Send From' address and the 'Test Email' sends alright. It seems that the form is not attempting to send but I'm at a loss to see where problem is occuring.

I swapped over SMTP settings to Mailtrap to try debug further but keep getting 'Connection Error' notice even using variety of config settings.

Host provider has checked routing of mail on server and all okay.

    Perch: 3.1.1, PHP: 7.2.6, MySQL: 5.6.39, with PDO
    Server OS: Linux, litespeed
    Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_forms (1.11)
    App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); ?>
    PERCH_LOGINPATH: /perch
    PERCH_PATH: /home3/s31820/public_html/perch
    PERCH_CORE: /home3/s31820/public_html/perch/core
    PERCH_RESFILEPATH: /home3/s31820/public_html/perch/resources
    Image manipulation: GD
    PHP limits: Max upload 64M, Max POST 64M, Memory: 128M, Total max file upload: 64M
    F1: 3b606135b33e6a102526838f4152a807
    Resource folder writeable: Yes
    HTTP_HOST: spiddalanglingschool.com
    DOCUMENT_ROOT: /home3/s31820/public_html
    REQUEST_URI: /perch/core/settings/diagnostics/
    SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

I have added extra email settings to config.php. Here's the settings used for the form:

    define('PERCH_EMAIL_FROM', 'info@spiddalanglingschool.com');
    define('PERCH_EMAIL_FROM_NAME', 'Diarmuid Thornton');
    define('PERCH_EMAIL_METHOD', 'smtp');
    define('PERCH_EMAIL_HOST', 'kobe.webhostingireland.ie');
    define('PERCH_EMAIL_SECURE', 'ssl');
    define('PERCH_EMAIL_AUTH', true);
    define('PERCH_EMAIL_PORT', 465);
    define('PERCH_EMAIL_USERNAME', 'info@spiddalanglingschool.com');
    define('PERCH_EMAIL_PASSWORD', '*****');

Here is the debug info which outputs from contact form page (contact.php) when a form is sent:

Debug Message - Perch 3.1.1
[15] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] SELECT * FROM perch2_forms WHERE formKey='get_in_touch' LIMIT 1
[1] SELECT * FROM perch2_pages WHERE pagePath='/contact.php' LIMIT 1

Array (
    [fields] => Array
        (        )
    [files] => Array
        (        )
    [page] => Array
        (   [id] => 6
            [title] => Contact
            [path] => /contact.php
            [navtext] => Contact
        )
)

INSERT INTO perch2_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"name\":{\"attributes\":{\"type\":\"text\",\"id\":\"name\",\"required\":\"true\",\"label\":\"Name\",\"class\":\"text\"},\"value\":\"Orla Kirwan\"},\"telephone\":{\"attributes\":{\"type\":\"text\",\"id\":\"telephone\",\"required\":\"true\",\"label\":\"Telephone\",\"class\":\"text\"},\"value\":\"0874163565\"},\"email\":{\"attributes\":{\"type\":\"email\",\"id\":\"email\",\"required\":\"true\",\"label\":\"Email\",\"class\":\"text\",\"\":true},\"value\":\"kirwan.orla@gmail.com\"},\"courses\":{\"attributes\":{\"type\":\"checkbox\",\"id\":\"courses\",\"label\":\"Courses\",\"value\":\"true\"},\"value\":\"true\"},\"enquiry\":{\"attributes\":{\"type\":\"textarea\",\"id\":\"enquiry\",\"required\":\"true\",\"label\":\"Enquiry or Message\",\"\":true},\"value\":\"Testing 14.37\"}},\"files\":[],\"page\":{\"id\":\"6\",\"title\":\"Contact\",\"path\":\"\\/contact.php\",\"navtext\":\"Contact\"}}','4','185.51.72.72','{\"fields\":[],\"environment\":{\"PATH\":\"\\/bin:\\/usr\\/bin:\\/usr\\/local\\/bin\",\"HTTP_ACCEPT\":\"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,*\\/*;q=0.8\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"HTTP_ACCEPT_LANGUAGE\":\"en-US,en;q=0.5\",\"HTTP_CONNECTION\":\"keep-alive\",\"CONTENT_TYPE\":\"application\\/x-www-form-urlencoded\",\"CONTENT_LENGTH\":\"208\",\"HTTP_COOKIE\":\"PHPSESSID=dcd981d9f569966d4ef9af4aa12fe9f5; cmsa=1\",\"HTTP_HOST\":\"spiddalanglingschool.com\",\"HTTP_REFERER\":\"https:\\/\\/spiddalanglingschool.com\\/contact.php\",\"HTTP_USER_AGENT\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko\\/20100101 Firefox\\/60.0\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"HTTP_UPGRADE_INSECURE_REQUESTS\":\"1\",\"DOCUMENT_ROOT\":\"\\/home3\\/s31820\\/public_html\",\"REMOTE_ADDR\":\"185.51.72.72\",\"REMOTE_PORT\":\"31305\",\"SERVER_ADDR\":\"91.210.235.230\",\"SERVER_NAME\":\"spiddalanglingschool.com\",\"SERVER_ADMIN\":\"webmaster@spiddalanglingschool.com\",\"SERVER_PORT\":\"80\",\"REQUEST_URI\":\"\\/contact.php\",\"SCRIPT_FILENAME\":\"\\/home3\\/s31820\\/public_html\\/contact.php\",\"QUERY_STRING\":\"\",\"SCRIPT_URI\":\"https:\\/\\/spiddalanglingschool.com\\/contact.php\",\"SCRIPT_URL\":\"\\/contact.php\",\"SCRIPT_NAME\":\"\\/contact.php\",\"SERVER_PROTOCOL\":\"HTTP\\/1.1\",\"SERVER_SOFTWARE\":\"LiteSpeed\",\"REQUEST_METHOD\":\"POST\",\"X-LSCACHE\":\"on\",\"PHP_SELF\":\"\\/contact.php\",\"REQUEST_TIME_FLOAT\":1530022952.970839977264404296875,\"REQUEST_TIME\":1530022952}}')
[1] SELECT * FROM perch2_forms_responses WHERE responseID='316' LIMIT 1
No ids to log.

Any ideas? Orla

Orla Kirwan

Orla Kirwan 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What settings do you have configured for the form itself? It looks like it's set to store responses, but is it set to email them too?

Hi Drew,

The form is set to send them alright - the other settings: the 'Send From' address matches that in the config settings and the 'Email Address Field' is set to 'email'.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's odd. It's saving the responses ok?

Thanks Drew, I thought so too. I've been back and forth with host provider too and it seems it was a routing thing on their end after all.

It's solved now!