Mamad_Ch's avatar

Problem sending email in Laravel

Hi everyone Has anyone ever encountered this error? It gives me this error when I try to send a verification email to the user

ErrorException: stream_socket_enable_crypto(): Peer certificate CN=`server36c.*.com' did not match expected CN=`mail.domin.com'

I searched a lot before the question, but none of the answers helped me :(

0 likes
4 replies
tomasosho's avatar

check your email configuration in .env file make sure it is correct

tomasosho's avatar
MAIL_MAILER=smtp
MAIL_HOST=host_from_email_setting
MAIL_PORT=465
MAIL_USERNAME=email_address
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=from_anyaddress_typically_no_reply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
chiefguru's avatar

@mohammad79 Double check your port and encryption settings with your SMTP provider. SSL usually requires a certificate file and sometimes you need to add/set extra options for it to work.

The more common setup is to use TLS on port 587. This is what we use with Amazon SES and Mailtrap.

Doh! replied to wrong person.

1 like

Please or to participate in this conversation.