We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Hosting, Forms

Forms not sending

Hello,

I'm 99.999% sure what the issue is, but i have no idea how to go about fixing it.

The client has changed some DNS settings to use an alternative company for their emails.

autodiscover.website-name.co.uk - CNAME - autodiscover.pentangle.co.uk and a few MX Records.

Since then they don't get their forms via email, the perch admin still gets them.

Can you get perch to send the forms via SMTP?

i'm a bit stuck, any help very much appreciated.

Stephen Wild

Stephen Wild 3 points

  • 1 year ago

Hi Stephen

Contact the host to see if there's an internal SMTP account set up for you to use with scripts.

If there is then just enter them into the config file as per the docs:

https://docs.grabaperch.com/perch/configuration/email/

Trying to get your client's email server to authorise external smtp calls is a nightmare.

I am seeing more and more hosts block, or severely curtail phpmailer and the like, and often this is the workaround for cloud based hosting.

Hope this helps you on your way!

Jon

I tried it using gmail and it just hangs... on the front end form submit, and on the admin 'Test email settings'

I've tried TLS and SSL setting and I have enabled "less secure apps settings" on gmail

define('PERCH_EMAIL_METHOD', 'smtp');
define('PERCH_EMAIL_HOST', 'smtp.gmail.com');
define('PERCH_EMAIL_AUTH', true);
define('PERCH_EMAIL_SECURE', 'TLS');
define('PERCH_EMAIL_PORT', 587);
define('PERCH_EMAIL_USERNAME', '********');
define('PERCH_EMAIL_PASSWORD', '*******');
define('PERCH_EMAIL_METHOD', 'smtp');
define('PERCH_EMAIL_HOST', 'smtp.gmail.com');
define('PERCH_EMAIL_AUTH', true);
define('PERCH_EMAIL_SECURE', 'SSL');
define('PERCH_EMAIL_PORT', 465);
define('PERCH_EMAIL_USERNAME', '********');
define('PERCH_EMAIL_PASSWORD', '*******');

Anyone got any ideas

Ok, so I have abandoned the Gmail SMTP, and used my own one for the client.

The Perch test email came through fine, but the website form is still only storing on the database, its not being posted via email.

Can anyone help?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'd suggest looking at the mail error log on the server as that will tell you what you need to know, anything else is just going to be a guess.

If you use perch SMTP settings do the website forms send via this or is it just for forgotten passwords etc?

In the form admin it says "Requires a functioning mail server that can send mail from PHP." Which the client host does not have

Thanks

Yes, forms will send through whatever you configure as the mail server: PHP by default, SMTP if you override it in config - as you have.

Rachel's right in that the answer probably lies in the mail logs. There are so many things it could be that's stopping the mail reaching the recipient: Client's mail server, DNS settings, firewalls and the like.

Did you try contacting the host and seeing what they recommend and/or whether they had an internal smtp server you can use?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Also turn on debug for the page to make sure that Perch is trying to send the email. If your form is misconfigured it might not be set up to send.