I have a very strange error. It says that my PHP file ends when it is unexpected. I do not see any errors in my code. Anyway it is sample code from tutorial of PHPMailer, so it should not be not working. Can somebody explain? My code:
<?php
require 'phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer; // Passing `true` enables exceptions
try {
//Server settings
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.comcast.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'hmmmm@gmail.com'; // SMTP username
$mail->Password = 'Password'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->From = 'hmmm@gmail.com';
$mail->FromName = 'Michael';
$mail->addAddress('adress@gmail.com'); // Add a recipient
$mail->addAddress('adress2.19@gmail.com'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
//Attachments
// $mail->WordWrap = 50
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send()
?>