require_once ("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->IsHTML(true); $mail->SMTPDebug = 1; $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "tls"; // sets the prefix to the servier ssl or tls $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 587; // set the SMTP port for the GMAIL server 465 or 587 $mail->Username = "mygmailaddress"; // GMAIL username $myemail $mail->Password = "mypassword"; // GMAIL password $mail->SetFrom('emailaddress','Admin'); // "name@yourdomain.com"; $mail->FromName = $yourname; // set from Name $mail->Subject = $subject; $mail->Body = $message; $mail->AddAddress("emailaddress"); // to Address if($mail->Send()) { echo "<html><body><span>Thank you for your enquiry. Please</span><a href=enquiry.html>Click Hear</a><span>to continue</span></body></html>"; } else { echo "<html><body><span>Error in sending email. Please</span><a href=enquiry.html>Click Hear</a><span>to continue</span></body></html> "; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)