SMTPDebug = 3;
$mail->Host = 'smtp.Yandex.com'; // SMTP server
$mail->Port = 465;
// optional
// used only when SMTP requires authentication
$mail->SMTPAuth = true;
$mail->Username = 'contact@stoneworksbuilders.com';
$mail->Password = 'UyU4Qx6JtC7M';
$mail->SMTPSecure = 'ssl';
$mail->IsSMTP();
//From email address and name
//$mail->From = "poovarasi@webberax.com";
//$mail->FromName = "Poovarasi";
$mail->setFrom('contact@stoneworksbuilders.com', 'stoneworksbuilders');
//To address and name
$mail->addAddress($email1, $name1);
//$mail->addAddress('aswini@webberax.com', 'hello');
//$mail->addAddress("recepient1@example.com"); //Recipient name is optional
//Address to which recipient will reply
$mail->addReplyTo("contact@stoneworksbuilders.com", "Reply");
//CC and BCC
//$mail->addCC("aswinihari6@gmail.com");
//$mail->addBCC("bcc@example.com");
//Send HTML or Plain Text email
$mail->isHTML(true);
$mail->Subject = "This e-mail was sent from a subscribe form on (http://stoneworksbuilders.com)";
$mail->Body = "
This e-mail was sent from a subscribe form on (http://stoneworksbuilders.com)";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: ";
}
else
{
echo "Message has been sent successfully";
}
//PHPMailer Object
$mail2 = new PHPMailer;
//$mail->SMTPDebug = 3;
$mail2->Host = 'smtp.Yandex.com'; // SMTP server
$mail2->Port = 465;
// optional
// used only when SMTP requires authentication
$mail2->SMTPAuth = true;
$mail2->Username = 'contact@stoneworksbuilders.com';
$mail2->Password = 'yu5TQDxcVFsy';
$mail2->SMTPSecure = 'ssl';
$mail2->IsSMTP();
$mail2->setFrom('contact@stoneworksbuilders.com', 'stoneworksbuilders');
$mail2->addAddress('contact@stoneworksbuilders.com', 'stoneworksbuilders');
$mail2->isHTML(true);
$mail2->Subject = "Subscribed Details";
$mail2->Body = "
Following user has subscribed your website
Name : $name1
Email : $email1
";
$mail2->send();
}
}
?>