Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require ('../../class/class.phpmailer.php');
- require '../../class/class.smtp.php';
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPSecure = 'ssl';
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 465;
- $mail->Username = 'test@gmail.com';
- $mail->Password = '**********';
- $mail->SMTPKeepAlive = true;
- $mail->Mailer = "smtp";
- $mail->SMTPAuth = true;
- $mail->CharSet = 'utf-8';
- $mail->setFrom('test@gmail.com', 'Test');
- $mail->addAddress('testok@gmail.com', 'Mensaje de Prueba');
- $mail->Subject = 'Mensaje';
- $mail->Body = 'Cuerpo';
- $test =$mail->Send();
- if($test) {
- echo 'Enviado.';
- echo 'Mailer error: ' . $mail->ErrorInfo;
- } else {
- echo 'Error.';
- }
- ?>
Add Comment
Please, Sign In to add comment