Plesk

Unable to send an email via WordPress mail plugin: stream_socket_enable_crypto(): Peer certificate did not match expected

Symptoms

Cause

Incorrect SMTP Host is specified in plugin.

Resolution

Use server hostname(server.hostname.com) in WP Admin > Settings > Email > SMTP Host instead of localhost.

Hostname can be found at Plesk > Home page or in  MailEnable > Services > localhost > Services  and Connectors > SMTP Properties > General > Local domain name

Note: Mail server must be secured by SSL certificate .