Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // include the PHPMailer main class
- require("class.phpmailer.php");
- $username = 'nmcclaran0730@gmail.com';
- $password = 'consolidate';
- $recipient= array('email'=>'nmcclaran@yahoo.com', 'name'=>'Nikki');
- $webmaster = array('email'=>'nmcclaran0730@gmail.com', 'name'=>'Webmaster');
- $mail = new PHPMailer ();
- $mail->IsSMTP();
- $mail->Host= "smtp.gmail.com:587";
- $mail->SMTPAuth = true;
- $mail->Username = $username;
- $mail->Password= $password;
- $mail->SetFrom($webmaster['email'], $webmaster['name']);
- $mail->AddAddress($recipient['email'], $recipient['name']);
- $mail->Subject = "This is the Subject";
- $mail->Body = "This is simply a test, does it work?";
- if(!$mail->Send()) {
- echo "<b>Oops:</b> An error was encountered... " . $mail->ErrorInfo;
- } else {
- echo "<b>Yay:</b> Message sent successfully.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement