Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- $mail->Host = 'smtp.gmail.com';
- //$mail->isSMTP();
- $mail->SMTPDebug = 2;
- $mail->SMTPAuth = true;
- $mail->Username = 'example@gmail.com';
- $mail->Password = 'password';
- $mail->SMTPSecure = 'ssl';
- $mail->Port = 465; // for tls 587
- $mail->Subject = 'Test Email';
- $mail->isHTML(true);
- $mail->Body = 'Message from test website';
- $mail->setFrom('mahmood.bts@gmail.com');
- $mail->addAddress('test@companyname.com');
- $mail->addCC('info@companyname.com');
- if($mail->send())
- echo "mail is sent";
- else
- echo $mail->ErrorInfo;
- ?>
Add Comment
Please, Sign In to add comment