0

I'm trying to get outbound mail set up. With CiviCRM 5.70.1 on PHP8.1, if I configure it to send via mail() then the test message works successfully, but I can see that my transactional emails, a membership receipt email is the one i'm interested in, is getting sent but is malformed (it's like bits of the metadata in the email are missing, resulting in a badly messed up message that is barely readable). I've seen the same thing on a different install, and that was resolved by sending out via SMTP instead, and in that case I get good results by configuring the SMTP settings to use to 'localhost' as my SMTP server on port 25 with no authentication. That's on a server currently running on PHP 7.4 and slightly older version of CiviCRM.

Using the exact same settings on my 5.70.1 install, I get a fatal error. Looking in the logs I see in the CiviCRM log just this:

[error] not connected

and in my apache error log I see:

Got error 'PHP message: PHP Warning:  Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rp/sites/live/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2123
PHP message: PHP Warning:  Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2123
PHP message: PHP Warning:  Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2123
PHP message: PHP Warning:  Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2123
PHP message: PHP Warning:  Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2123
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function fsockopen() in /wp-content/plugins/civicrm/civicrm/vendor/pear/net_socket/Net/Socket.php:165

Clearly CiviCRM is not happy with what I'm providing by way of settings. But it doesn't seem to matter what I put in the SMTP settings fields - I get the same fatal error regardless. Wondering if this is a bug in 5.70.1?

2
  • What do you have in php.ini for allow_url_fopen and/or is curl enabled in php.ini's extensions section?
    – Demerit
    Commented Mar 1 at 21:21
  • allow_url_fopen is set to On. cURL support is enabled.
    – Graham
    Commented Mar 4 at 10:23

1 Answer 1

1

Transpires that the user under which the site runs had fsockopen listed as one of the PHP disable_functions. Removing that constraint solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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