Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $para .= 'wez@example.com';
- $título = 'Recordatorio de cumpleaños para Agosto';
- $mensaje = 'Hola';
- $cabeceras = 'MIME-Version: 1.0' . "rn";
- $cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
- $cabeceras .= 'To: Mary , Kelly ' . "rn";
- $cabeceras .= 'From: Recordatorio ' . "rn";
- $cabeceras .= 'Cc: birthdayarchive@example.com' . "rn";
- $cabeceras .= 'Bcc: birthdaycheck@example.com' . "rn";
- mail($para, $título, $mensaje, $cabeceras);
- <?php
- //Load
- require_once('PHPMailer/PHPMailerAutoload.php');
- $mail = new PHPMailer(true);
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- $mail->SMTPDebug = 2;
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- //$mail->SMTPSecure = "ssl";
- $mail->SMTPSecure = 'tls';
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;// TCP port to connect to
- $mail->CharSet = 'UTF-8';
- $mail->Username ='algien@gmail.com'; //tu gmail
- $mail->Password = '31542'; //tu password
- //Agregar destinatario
- $mail->setFrom('user@mail.com', 'Mary , Kelly');
- $mail->AddAddress('wez@example.com');//A quien mandar email
- $mail->SMTPKeepAlive = true;
- $mail->Mailer = "smtp";
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Recordatorio de cumpleaños para Agosto';
- $mail->Body = 'Hola</b>';
- if(!$mail->send()) {
- echo 'Error al enviar email';
- echo 'Mailer error: ' . $mail->ErrorInfo;
- } else {
- echo 'Mail enviado correctamente';
- }
Add Comment
Please, Sign In to add comment