newton
1
(epiz_30455040)
newton.great-site.net
Hey, i am trying to send message to my email and I get error, message not send.
my code include:
<?php
if(isset($_POST['submit'])){
require './phpmailer/PHPMailerAutoload.php';
//require './phpmailer/class.smtp.php';
//require './phpmailer/class.phpmailer.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = '
[email protected]';
$mail->Password = 'newton%2020';
$mail->setFrom($_POST['email'],$_POST['first_name'], $_POST['last_name']);
$mail->addAddress('
[email protected]');
$mail->addReplyTo($_POST['email'], $_POST['first_name']);
$mail->isHTML(true);
$mail->Subject = 'Website Enquiries Needed';
$mail->Body = '
FirstName: '.$_POST['first_name'].'
LastName: '.$_POST['last_name'].'
Email: '.$_POST['email'].'
Phone: '.$_POST['phone'].'
Message: '.$_POST['message'].'
';
if(!$mail->send()){
$danger = 'Message not Sent!!';
}else{
$result = "Thanks, ".$_POST['first_name']." for contacting. Will Keep in touch.";
}
}
?>
You can use this as an example. In the future, please format your code be placing “~~~” before and after it.
4 Likes
system
Closed
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.