On my website I have a simple contact form but I can't figure out why I can't send email.
HTML:
<form id="contactForm" method="post" action="js/sendmail.php" >
<fieldset>
<p><label for="name" class="label">Name*:</label>
<input type="text" name="name" id="Text1" class="input required" />
</p>
<p><label for="email" class="label">Email*: </label>
<input type="email" name="email" id="contact_email" class="input email required" />
<span class="input_feedback"></span>
</p>
<p>
<label class="label">Your message*: </label>
<textarea class="textarea required" name="message" rows="10" cols="50" ></textarea>
</p>
<p class="submitButtons">
<input type="submit" value="Send email" id="senEmail" class="button"/>
</p>
</fieldset>
</form>
PHP:
<?php
include('class.phpmailer.php');
include("class.smtp.php");
session_set_cookie_params('3600'); // 1 hour
session_start();
$mail->SMTPSecure = "ssl";
$mail->SMTPKeepAlive = true;
$mail->Mailer = "smtp";
$mail = new PHPMailer(); // create a new object
$mail->SMTPDebug =2;
$mail->IsSMTP(); // send via SMTP
$mail ->Host = 'mrvnet.kundenserver.de';
$mail->Port= 465;
$mail->SMTPAuth = true;
$mail->Username = 'info@brightongatwicktransfer.com';
$mail->Password = '******';
$mail->SetFrom('myName@yahoo.com');
$mail->Subject = "Test";
$mail->Body = "Something";
$mail->AddAddress('info@brightongatwicktransfer.com');
if(!$mail->Send())
{ echo "Mailer Error: " . $mail->ErrorInfo;}
else
{ echo "Message has been sent";}
?>
I tried with 'ssl' and 'tls' but no results.
Host company said the host is correct and asked me to try with 587 and 25 ports but I always received the same error:
2013-12-04 11:40:00 SMTP ERROR: Failed to connect to server: A connection attempt
failed because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond. (10060)
SMTP connect() failed. Mailer Error: SMTP connect() failed.