Forum

Thread tagged as: Problem, Forms

Perch Forms Not sending Email

The form is coming into the list responses, the test email works, the email can send and receive emails, the success message works. But the notification email is not coming in.

Debug

Debug Message - Perch 3.0.10
[1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='201104dd0700ee571e19288bd71657e1' LIMIT 1
UPDATE perch2_users SET userHash='407fcfcb5c997ba648deac4769f4f8b4' WHERE userID='1'
[21] SELECT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[7] SELECT itemValue FROM perch2_menu_items WHERE itemType='app'
[1] SELECT * FROM perch2_forms WHERE formID='1' LIMIT 1
[2] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_forms_responses WHERE formID=1 AND responseSpam=0 ORDER BY responseCreated DESC LIMIT 0, 10
[2] SELECT FOUND_ROWS() AS `count`
[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch2_menu_items WHERE itemType='app' AND itemValue='perch_forms' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /addons/apps/perch_forms/modes/responses.list.post.php
Queries: 13
Memory: 2.6556

Form Code


<perch:form id="contact" method="post" action="#success" app="perch_forms"> <div class="control-group"> <perch:label class="control-label" for="name">Name</perch:label> <div class="controls"> <perch:input type="text" id="name" required="true" class="input-xlarge" label="Name" /> <perch:error for="name" class="input-xlarge" type="required">Please add your name</perch:error> </div> </div> <div class="control-group"> <perch:label class="control-label" for="email">Email</perch:label> <div class="controls"> <perch:input type="email" id="email" required="true" class="input-xlarge" label="Email" placeholder="you@company.com" /> <perch:error for="email" type="required">Please add your email address</perch:error> <perch:error for="email" type="format">Please check your email address</perch:error> </div> </div> <div class="control-group"> <perch:label class="control-label" for="phone">Phone Numbers</perch:label> <div class="controls"> <perch:input type="text" id="phone" required="false" class="input-xlarge" label="Phone" placeholder="555-555-5555" /> <perch:error for="email" type="required">Please add your phone number</perch:error> </div> </div> <div class="control-group"> <perch:label class="control-label" for="message">Message</perch:label> <div class="controls"> <perch:input type="textarea" id="message" required="true" class="input-xlarge" label="Message" /> <perch:error for="message" type="required">Please add a message</perch:error> </div> </div> <div class="control-group"> <div class="controls"> <perch:input type="submit" id="submit" value="Send" class="btn btn-primary"/> </div> </div> <div class="control-group"> <div class="controls"> <perch:success "> <perch:content id="success" label="Success Message" type="textarea" textile="true" editor="markitup" /> </perch:success> </div> </div> </perch:form>

Please help!

Brittany Lewis

Brittany Lewis 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tested with something like mailtrap.io?

No I haven't. What will this tell me?

It will tell you if your installation/server email is working, and allow us (Developers) to help determine/investigate if you have software or server issue.

The nice thing about mailtrap.io is there is no inbox filtering and spam filters, so if your server sends, mailtrap will receive and it won’t be filtering and hiding the messages. Also it has a really good logging system which will help you pinpoint issues.

My email has worked on a perch form on this same server previously.

But it must not be now as you're here looking for help. It would really be helpful if you could provide your diagnostic report, and provide details as to what has recently changed since you received the last email.

A reply of "nothing has changed" is obviously not helpful because something has had to change or nothing would be different. Maybe your host has updated something on the server, you updated perch or a perch app... We want to help... but this will require some more information.

RK

Perch: 3.0.10, PHP: 5.6.31, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_forms (1.9.1)
App runtimes: <?php $apps_list = [ 'perch_forms', ];
PERCH_LOGINPATH: /login
PERCH_PATH: /home/syvmarriott/public_html/login
PERCH_CORE: /home/syvmarriott/public_html/login/core
PERCH_RESFILEPATH: /home/syvmarriott/public_html/login/resources
Image manipulation: GD
PHP limits: Max upload 128M, Max POST 128M, Memory: 512M, Total max file upload: 128M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/syvmarriott/public_html
HTTP_HOST: syvmarriott.com
REQUEST_URI: /login/core/settings/diagnostics/
SCRIPT_NAME: /login/core/settings/diagnostics/index.php

On the same server, I can put in my email in this other form and the email will send to me. I'm not saying "nothing has changed" I'm saying my email in another form on the same server is currently working.

Below is the diagnostics report for the perch site with the form currently working with my email. these sites are both hosted on the same server.

Perch: 3.0.10, PHP: 7.0.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_blog (5.6.1), perch_forms (1.9.1), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', 'perch_mailchimp', ];
PERCH_LOGINPATH: /login
PERCH_PATH: /home/twhospitality/public_html/login
PERCH_CORE: /home/twhospitality/public_html/login/core
PERCH_RESFILEPATH: /home/twhospitality/public_html/login/resources
Image manipulation: GD
PHP limits: Max upload 128M, Max POST 128M, Memory: 512M, Total max file upload: 128M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/twhospitality/public_html
HTTP_HOST: twhospitality.com
REQUEST_URI: /login/core/settings/diagnostics/
SCRIPT_NAME: /login/core/settings/diagnostics/index.php

Please confirm, in cms go to settings, email and put an email address in and let me know if that email sends and is received, this will tell us sending is working, then we will have a good start

"You're good to go!

This is a test email to check that your server's email settings are correctly configured.

As you have received this message, everything seems to be fine!"

yes it is

Everything online looks right in the html, I am going to try the posted template in my dev right now and see if it sends for me...

using your posted template with no modification I was able to complete the form and it sent, so it isn't a template issue...

Debug Message - Perch Runway 3.0.9
[23] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch3_pages p LEFT JOIN perch3_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch3_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch3_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
Matched page: /test, so not using routes.
Using master page: /templates/pages/test/test.php
[1] SELECT * FROM perch3_pages WHERE pagePath='/test' LIMIT 1
[1] SELECT * FROM perch3_shop_cart WHERE cartID=46
[1] SELECT * FROM perch3_shop_cart WHERE cartID=46
[nil] SELECT * FROM perch3_shop_sales WHERE saleFrom<='2017-10-27 03:52:00' AND saleTo>'2017-10-27 03:52:00' AND saleActive=1 AND saleDeleted IS NULL ORDER BY saleOrder ASC
[56] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] SELECT * FROM perch3_forms WHERE formKey='contact' LIMIT 1
Array
(
    [fields] => Array
        (
        )

    [files] => Array
        (
        )

    [page] => Array
        (
            [id] => 30
            [title] => test
            [path] => /test
            [navtext] => test
        )

)
Building message with Dollar template
Sent email: "Nest running club contact form" to nest@localhost.local
INSERT INTO perch3_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"name\":{\"attributes\":{\"type\":\"text\",\"id\":\"name\",\"required\":\"true\",\"class\":\"input-xlarge\",\"label\":\"Name\"},\"value\":\"Robert Ketter\"},\"email\":{\"attributes\":{\"type\":\"email\",\"id\":\"email\",\"required\":\"true\",\"class\":\"input-xlarge\",\"label\":\"Email\",\"placeholder\":\"you@company.com\"},\"value\":\"robert@domain.us\"},\"phone\":{\"attributes\":{\"type\":\"text\",\"id\":\"phone\",\"required\":false,\"class\":\"input-xlarge\",\"label\":\"Phone\",\"placeholder\":\"555-555-5555\"},\"value\":\"304-555-1212\"},\"message\":{\"attributes\":{\"type\":\"textarea\",\"id\":\"message\",\"required\":\"true\",\"class\":\"input-xlarge\",\"label\":\"Message\"},\"value\":\"testing\"}},\"files\":[],\"page\":{\"id\":\"30\",\"title\":\"test\",\"path\":\"\\/test\",\"navtext\":\"test\"}}','1','::1','{\"fields\":[],\"environment\":{\"REDIRECT_STATUS\":\"200\",\"HTTP_HOST\":\"nest.local\",\"HTTP_CONNECTION\":\"keep-alive\",\"CONTENT_LENGTH\":\"176\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"HTTP_ORIGIN\":\"https:\\/\\/nest.local\",\"HTTP_UPGRADE_INSECURE_REQUESTS\":\"1\",\"CONTENT_TYPE\":\"application\\/x-www-form-urlencoded\",\"HTTP_USER_AGENT\":\"Mozilla\\/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/61.0.3163.100 Safari\\/537.36\",\"HTTP_ACCEPT\":\"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8\",\"HTTP_REFERER\":\"https:\\/\\/nest.local\\/test\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"HTTP_ACCEPT_LANGUAGE\":\"en-US,en;q=0.8\",\"HTTP_COOKIE\":\"cmsa=1; PHPSESSID=2cb8c4c7237a294252ad9fbf7ed79bb8\",\"PATH\":\"\\/bin:\\/sbin:\\/usr\\/bin:\\/usr\\/sbin:\\/usr\\/libexec:\\/System\\/Library\\/CoreServices\",\"SERVER_SIGNATURE\":\"\",\"SERVER_SOFTWARE\":\"Apache\",\"SERVER_NAME\":\"nest.local\",\"SERVER_ADDR\":\"::1\",\"SERVER_PORT\":\"80\",\"REMOTE_ADDR\":\"::1\",\"DOCUMENT_ROOT\":\"\\/www\\/sites\\/nest.local\\/wwwroot\",\"SERVER_ADMIN\":\"you@example.com\",\"SCRIPT_FILENAME\":\"\\/www\\/sites\\/nest.local\\/wwwroot\\/perch\\/core\\/runway\\/start.php\",\"REMOTE_PORT\":\"52047\",\"REDIRECT_URL\":\"\\/test\",\"GATEWAY_INTERFACE\":\"CGI\\/1.1\",\"SERVER_PROTOCOL\":\"HTTP\\/1.1\",\"REQUEST_METHOD\":\"POST\",\"QUERY_STRING\":\"\",\"REQUEST_URI\":\"\\/test\",\"SCRIPT_NAME\":\"\\/perch\\/core\\/runway\\/start.php\",\"PHP_SELF\":\"\\/perch\\/core\\/runway\\/start.php\",\"REQUEST_TIME_FLOAT\":1509076363.6879999637603759765625,\"REQUEST_TIME\":1509076363,\"argv\":[],\"argc\":0}}')
[1] SELECT * FROM perch3_forms_responses WHERE responseID='5' LIMIT 1
No ids to log.
Using template: /templates/forms/test.html
Request time: 0.6201
Process time: 0.6193
Memory: 5.6378
Here's a message someone has sent from the website contact form.

Name:                         Robert Ketter
Email:                        robert@domain.us
Phone:                        304-555-1212
Message:                      
testing

What are your settings in Perch Forms "options" for this form? There is a checkbox to "Send response via email"...

Are the responses at least showing up in perch_forms?

Yes, the checkbox is selected and the responses are coming into perch

Ok, This really seems like SMTP issue. You really need to try mailtrap.io to verify, because everything "Perch" seems to be working, and when I sent the form on your live site, it showed me the success message, so I am pretty sure it worked, but I didn't get a response in email.

RK

It doesn't seem to be an SMTP issue because our other form is running the same SMTP settings and I can receive notification emails from that form.

Have you tried the mailtrap as suggested at least twice above? Your asking for help, yet fighting the attempt to help you.

I am just trying to walk through the steps which help to isolate the issue.

Just because another site on the same server works does not mean all sites will work, as each site is a separate occurrence, which just happens to be on the same server.

We configured with what mailtrap has provided and still did not receive an email

It might be best to completely remove the forms app, and reinstall, this will not harm any of your templates. I would re-download forms app, then do fresh install. Maybe some file is missing, or corrupted.

We have resolved the issue. We changed define('PERCH_EMAIL_METHOD', 'smtp'); to define('PERCH_EMAIL_METHOD', 'sendmail');