Hello everyone,
I am trying to set up PHPmailer but this is the first time and I basically have no idea what I am doing! I have read the online tutorials and even watched videos on youtube but still do not understand how to get it working at all. I have added the phpmailer file into my site and put the require 'class.phpmailer.php; into the very start of my page that has the form on it that I want to email. Now when I open up my page it is completely blank? I also do not understand what to put in the settings? Any help is really appreciated.
Here is the code I have put into the start of my page:
[code]<?php
require ‘class.phpmailer.php’;
$mail = new PHPMailer;
$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = ‘smtp1.example.com’; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ‘jswan’; // SMTP username
$mail->Password = ‘secret’; // SMTP password
$mail->SMTPSecure = ‘tls’; // Enable encryption, ‘ssl’ also accepted
$mail->IsHTML(true); // Set email format to HTML
$mail->From = ‘[email protected]’;
$mail->FromName = ‘Mailer’;
$mail->AddAddress(‘[email protected]’, ‘Josh Adams’); // Add a recipient
$mail->Subject = ‘Here is the subject’;
$mail->Body = ‘This is the HTML message body in bold!’;
$mail->AltBody = ‘This is the body in plain text for non-HTML mail clients’;
if(!$mail->Send()) {
echo ‘Message could not be sent.’;
echo 'Mailer Error: ’ . $mail->ErrorInfo;
exit;
}
echo ‘Message has been sent’;
?>[/code]