SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'ssl://smtp.ukr.net'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'testmailerlab@ukr.net'; //SMTP username $mail->Password = '111111'; //SMTP password $mail->SMTPSecure = "ssl"; $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('testmailerlab@ukr.net', 'Test Mailer'); $mail->addAddress('mslabinoha@gmail.com', 'Marian Slabinoha'); //Add a recipient //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Feedback from website: '.$_POST['subject']; $mail->Body = 'From: '.$_POST['email'].'
'.$_POST['message']; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } ?> Mailing test