Can't set Outbound Mail to use SMTP without a fatal error
Using CiviCRM 5.70.1 I want to set up Outbound Mail to send via SMTP. I provide the relevant details and login credentials via the form that would let me send via the mail account that I've set up expressly for this purpose. On testing - using the 'Save and send a test' functionality I would expect to see a positive response, along with an email, or an on-screen error message to indicate that the details entered were in some way inaccurate.
However all I get is a fatal error. The log reports this as:
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
I tried various settings options, but it didn't matter what I entered into the settings form, I got the same result. I asked a question about this on StackExchange: https://civicrm.stackexchange.com/questions/47564/what-values-are-required-in-order-to-send-outbound-mail-via-smtp
Seeing that version 5.71 included significant changes to CiviMail, I upgraded my development site and retested. Same result:
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2140;
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2140;
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2140;
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2140;
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Smtp::$_id in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2140;
PHP Fatal error: Uncaught Error: Call to undefined function fsockopen() in /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/vendor/pear/net_socket/Net/Socket.php:165
Stack trace:
#0 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/vendor/pear/net_smtp/Net/SMTP.php(451): Net_Socket->connect()
#1 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/vendor/pear/mail/Mail/smtp.php(449): Net_SMTP->connect()
#2 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/vendor/pear/mail/Mail/smtp.php(332): Mail_smtp->getSMTPObject()
#3 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/vendor/pear/mail/Mail/smtp.php(319): Mail_smtp->send_or_fail()
#4 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Utils/Mail/FilteredPearMailer.php(77): Mail_smtp->send()
#5 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting/Smtp.php(185): CRM_Utils_Mail_FilteredPearMailer->send()
#6 /home/rpdev/sites/dev/wp-content/plugins/civicrm/civicrm/CRM/...', referer: https://mysite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fsmtp&_qf_Smtp_display=true