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@newsletterwiki.com';
$mail->Password = 'HfkurnXSd96Vsasd';
$mail->SMTPSecure = 'ssl';
$mail->IsSMTP();
//From email address and name
//$mail->FromName = "vinoth";
$mail->setFrom('contact@newsletterwiki.com', 'Newsletterwiki');
//To address and name
$mail->addAddress($email, $name, $message);
//$mail->addAddress('vinothkumar@webberax.com', 'hello');
//$mail->addAddress("recepient1@example.com"); //Recipient name is optional
//Address to which recipient will reply
$mail->addReplyTo("contact@newsletterwiki.com", "Reply");
//CC and BCC
//$mail->addBCC("bcc@example.com");
//Send HTML or Plain Text email
$mail->isHTML(true);
$mail->Subject = "Newsletterwiki [Contact Replay]";
$mail->Body = "
This message confirms that you have successfully registered.
Thank you!
This e-mail was sent from a contact form on (http://newsletterwiki.com)";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: ";
}
else
{
echo "Success! check your email.";
}
//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@newsletterwiki.com';
$mail2->Password = 'HfkurnXSd96Vsasd';
$mail2->SMTPSecure = 'ssl';
$mail2->IsSMTP();
$mail2->setFrom('contact@newsletterwiki.com', 'Newsletterwiki');
$mail2->addAddress('contact@newsletterwiki.com', 'Newsletterwiki');
$mail2->isHTML(true);
$mail2->Subject = "Contact Details";
$mail2->Body = "
Following user has been submitted contact details on your website
Name : $name
Email : $email
Message: $message
";
$mail2->send();
}
}
?>