NamelessMC

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

Question Bug Errors Regarding PHPMailer
Started by TeamHR

TeamHR

TeamHR

Member
Joined
07 Jul 2022
Last Seen
14 Apr 2024
Topics
1
Posts
2

Case 1: When using SMTP server to send mail I am now getting this error.

SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=`linuxxx.xxxx.com' did not match expected CN=`smtp.xxxxx.net'

Case 2: While using PHPMailer (Internal)

Error: Message has lines too long for transport. (On Cpanel)

This only occur on following emails.
Verification Email
Password Reset Email
Considering It contains long string within the (Link) Button.

Does not occur with other emails.
Is there a way to reduce the character limit? I think my webhost has a limit on it.
Or Is there a way to fix SMTP mode. So I won't need internal mailer.

TeamHR · about 1 year ago · Last edited: about 1 year ago
TeamHR

TeamHR

Member
Joined
07 Jul 2022
Last Seen
14 Apr 2024
Topics
1
Posts
2

Bump ^

TeamHR · about 1 year ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
23 Dec 2024
Topics
41
Posts
1076

Hi,

I would always recommend using an SMTP server unless you are certain that the internal mail mechanism has been configured correctly by the web host.

There are a few things you can try changing in the file core/config.php to try to get SMTP working:

- Change port to 465 and secure from tls to ssl
- Change smtp_auth to false and port to 25 (not recommended, but worth trying at least)

Otherwise the error that you are seeing suggests that the SSL certificate is not configured correctly, it's probably one to ask your SMTP provider about.

Worst case, you can disable SSL verification altogether for emails by editing the file core/classes/Core/Email.php in a text editor, and replacing the contents with this code: https://gist.githubusercontent.com/samerton/59217d664a19e88c3a8e98d63ff3bb16/raw/b921a16d3b6ac27e6e81bed5647cec744484c0e9/Email.php (for Nameless version 2.1.x)

x1
Samerton · about 1 year ago