Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("src/PHPMailer.php");
- require("src/Exception.php");
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "gmail id"; // SMTP username
- $mail->Password = "mypassword"; // SMTP password
- $mail->From = "opensourcesivaprakash@gmail.com";
- $mail->FromName = "Mailer";
- $mail->AddAddress("siva.sing.sivan@gmail.com", "Josh Adams");
- $mail->AddAddress("sp"); // name is optional
- //$mail->AddReplyTo("opensourcesivaprakash@gmail.com", "Information");
- $mail->WordWrap = 50; // set word wrap to 50 characters
- //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
- //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
- $mail->IsHTML(true); // set email format to HTML
- $mail->Subject = "Here is the subject";
- $mail->Body = "This is the HTML message body in bold!";
- $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
- if(!$mail->Send())
- {
- echo "Message could not be sent.
- ";
- echo "Mailer Error: " . $mail->ErrorInfo;
- exit;
- }
- echo "Message has been sent";
Add Comment
Please, Sign In to add comment