Forum

Thread tagged as: Problem, Error

Can't send email using Perch

I've just uploaded my Perch'ed website to a client's server, and all works fine apart from when I try to send email (either from a Form on the front end, or from the Settings > Email page) I just get a white screen.

I've tried leaving it as using PHP's mail() function, and also tried some SMTP details and neither is working.

When I just put together a test script outside of Perch using PHP's mail function, it did send.

Here's my diagnostic:

Perch: 2.8.30, PHP: 5.3.28, MySQL: mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.30), assets (2.8.30), categories (2.8.30), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/sites/alternativesolutions.uk.com/public_html/perch
PERCH_CORE: /home/sites/alternativesolutions.uk.com/public_html/perch/core
PERCH_RESFILEPATH: /home/sites/alternativesolutions.uk.com/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 64M, Memory: 128M, Total max file upload: 64M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: www.alternativesolutions.uk.com
DOCUMENT_ROOT: /home/sites/alternativesolutions.uk.com/public_html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Paul Bell

Paul Bell 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you get a "white screen" then you have a PHP error, we need to know what that is to help.

We link to the information about this when you create a thread, but the direct link is https://solutions.grabaperch.com/development/why-am-i-getting-a-blank-page

Thanks, Rachel. Not my preferred hosting, so I've had to call to get logs emailed. This seems to be the relevant error:

alternativesolutions.uk.com [Wed Jul 20 11:22:55 2016] [error] [client 82.4.157.135:45670] AH01215: PHP Fatal error:  Class 'PHPMailer' not found in /home/sites/alternativesolutions.uk.com/public_html/perch/core/lib/PerchEmail.class.php on line 244: /home/sites/alternativesolutions.uk.com/public_html/perch/core/settings/email/index.php

Hi again - I've been able to resolve this. Once I saw the error I checked that the PHP Mailer file was present, and it was uploaded as a 0B file. Even after trying to update to latest version of Perch and upload just this file the same thing happened.

I eventually renamed the file and was able to upload it and rename it back on the server, so I've resolved this issue at least.

Thanks for your help.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What method are you using to deploy these files?

Just FTP at the moment. I have a version control workflow using Bitbucket and DeployHQ but due to some issues here that wasn't used this time. Is that generally more reliable? Seems strange that a file should fail to upload, and that it should be the same file each time.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure the failure rate would change, but you might get better awareness of the issues as there would be more checks in place. Deploying and knowing about a failure is much easier to deal with that getting a failure and not knowing it's happened.

True. I got some notifications of files that had failed to upload, but not that one for some reason. Hopefully that was the only file. I don't know if it's my poor internet or the hosting that is at fault (all uploaded fine to my own, better hosting, which I'd hoped the client would use.) Ah well, thanks for your help and advice.