$mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 1; $mail->SMTPAuth = true; $mail->SMTPSecure = 'tls'; $mail->Host = 'smtp.yandex.com'; $mail->Port = 587;