I've recently moved one of my websites to a new service provider and for some reason the forms have stopped working. My new provider is saying it's a problem with the script, but I'm using the same code on 2 other services and am having no such problems.
I'm using PHPMailer, authenticated via SMTP. The error I'm receiving is as follows:
SMTP -> ERROR: Failed to connect to server: Permission denied (13)SMTP Connect() failed. Message could not be sent.
Mailer Error: SMTP Connect() failed.
I've setup a very basic script as below for testing, but it's just not working on the new server, but yet the same script is working fine on another.
Can anyone tell me if it's something in the code or whether it's something my hosting provider needs to activate, I'm perplexed?
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = "<p><strong>Name:</strong> Name</p>";
$body .= "<p><strong>Email Address:</strong> Email</p>";
$body .= "<p><strong>Telephone:</strong> Tel</p>";
$mail->From = "email@example.com";
$mail->FromName = "sender";
$mail->Subject = 'Form';
$mail->AltBody = "Use an HTML compatible email viewer!";
$mail->SMTPAuth = "true";
$mail->Username = "firstname.lastname@example.org";
$mail->Password = "password";
$mail->Host = "mail.server.co.uk";
$mail->Port = 587;
$mail->SMTPDebug = true;
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;