Advertisement
Guest User

Untitled

a guest
May 5th, 2017
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.     function enviar_correo ($de, $nombreDe, $para, $nombrePara, $asunto, $cuerpo, $archivo){
  3.       require 'class.phpmailer.php';
  4.       $mail = new PHPMailer();
  5.       $mail->IsSMTP();
  6.       $mail->SMTPDebug = 1;
  7.       $mail->IsHTML(true);
  8.       $mail->Host = 'mail.fundafam.org.sv'; //cambiar host
  9.       $mail->SMTPAuth = true;
  10.       $mail->Username = "gguevara@fundafam.org.sv";//cambiar cuenta
  11.       $mail->Password = "yamigui";//cambiar clave
  12.       $mail->From = $de;
  13.       $mail->FromName = $nombreDe;
  14.       $mail->Subject =  $asunto;
  15.       $mail->Body =  $cuerpo;
  16.       if($archivo != ""){
  17.         $mail->AddAttachment($archivo);
  18.       }
  19.       $mail->AddAddress($para, $nombrePara);
  20.  
  21.       if (!$mail->Send()){
  22.           return false;
  23.       }else{
  24.           return true;
  25.       }
  26.      }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement