Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'phpmailer/PHPMailerAutoload.php';
- $mail = new PHPMailer();
- $mail->isSMTP();
- $mail->Host = "smtp.gmail.com";
- $mail->SMTPSecure = "ssl";
- $mail->Port = 465;
- $mail->SMTPAuth = true;
- $mail->Username = 'test@gmail.com';
- $mail->Password = 'password';
- $mail->setFrom('test@gmail.com', 'test');
- $mail->addAddress('test@gmail.com');
- $mail->Subject = 'mail';
- $mail->IsHTML(true);
- $mail->Body = 'test';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- } else {
- echo '<script>alert("Message has been sent successfully");</script>';
- }
- ?>
Add Comment
Please, Sign In to add comment