0

I am using SMTP details of remove server. Here is the code snippet.

    $mail = new PHPMailer;
    $mail->IsSMTP();                                      // Set mailer to use SMTP
    $mail->Host = isset($_GET['host'])?$_GET['host']:"mail.u@xyz.com";    
    $mail->Port = isset($_GET['port'])?$_GET['port']:"465";                            
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = "testemail@xyz.com";              
    $mail->Password = "xxx";               
    $mail->SMTPSecure = 'ssl';
    $mail->SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => true,
            'verify_peer_name' => true,
            'allow_self_signed' => false
        )
    );
    $mail->SMTPDebug=2;
Alpi
  • 3
  • 3

1 Answers1

1

Try checking SMTP restrictions on your server. If you are using shared hosting then you can contact your hosting provider. If you have WHM access then try this. WHM -> Server Configuration -> Tweak Settings -> Security -> Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)

Turn it off Hope that would fix the issue :)

Yusef
  • 36
  • 7