How do i use phpmailer on interworx its not sending emails

how do i use phpmailer on interworx its not sending emails

Hi

We would need more details to help by the forum

Have you checked the following

Mail server is running
Mail queue
Error logs for the siteworx account
Mail log send

Many thanks

John

2022-01-26 15:34:05 Connection: opening to ssl://domain.com:465, timeout=300, options=array()
2022-01-26 15:34:10 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://domain.com:465 (No connection could be made because the target machine actively refused it.) [F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\SMTP.php line 387]
2022-01-26 15:34:10 SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

Fatal error : Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub in F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php:1943 Stack trace: #0 F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php(1631): PHPMailer\PHPMailer\PHPMailer->smtpSend(‘Date: Wed, 26 J…’, ‘hie\r\n’) #1 F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php(1464): PHPMailer\PHPMailer\PHPMailer->postSend() #2 F:\xampp\htdocs\test.php(45): PHPMailer\PHPMailer\PHPMailer->send() #3 {main} thrown in F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php on line 1943

This is the error

Hi

The port needs to be 587 if using secure or add port 465 to mail server in msa

If this is a form on a siteworx account you could always use 25

Many thanks

John

2022-01-26 16:14:20 Connection: opening to ssl://domain.com:587, timeout=300, options=array()
2022-01-26 16:14:21 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F10B:SSL routines:ssl3_get_record:wrong version number [F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\SMTP.php line 387]
2022-01-26 16:14:21 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\SMTP.php line 387]
2022-01-26 16:14:21 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://zitunes.live:587 (Unknown error) [F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\SMTP.php line 387]
2022-01-26 16:14:21 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

Fatal error : Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub in F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php:1943 Stack trace: #0 F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php(1631): PHPMailer\PHPMailer\PHPMailer->smtpSend(‘Date: Wed, 26 J…’, ‘hie\r\n’) #1 F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php(1464): PHPMailer\PHPMailer\PHPMailer->postSend() #2 F:\xampp\htdocs\test.php(45): PHPMailer\PHPMailer\PHPMailer->send() #3 {main} thrown in F:\xampp\htdocs\vendor\phpmailer\phpmailer\src\PHPMailer.php on line 1943

when is use port 587

Hi,

From your dump, it’s trying to connect to “domain.com”.

If you want to post your code, I can help you, but it’s not related to Interworx whatsoever

Hi

Yes I concur it is nothing to do with IW as the folders show different

I think it needs to be 25 using start tls but depends on the mailer code

The error is telling you it cannot start secure

Many thanks

John

On second tough, it might be realted to SSL error with the nodeworx mail server…

You can try to ignore SSL errors in your phpmailer with

$phpmailer->SMTPOptions = [
  'ssl' => [
    'verify_peer' => false,
    'verify_peer_name' => false,
    'allow_self_signed' => true
  ]
];