Guest User

Untitled

a guest
Dec 18th, 2017
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. $correoRemitente = trim("correoEmpresa");
  2. $contrasena = trim("contraseña");
  3. $nombre = trim("Logistica ");
  4. $mail = new PHPMailer();
  5.  
  6. $mail->IsSMTP();
  7.  
  8. $mail->SMTPAuth = true;
  9. $mail->SMTPSecure = "tls";
  10. $mail->Host = "outlook.office365.com";
  11. $mail->Port = 25;
  12.  
  13. $mail->Username = $correoRemitente;
  14. $mail->Password = $contrasena;
  15.  
  16. $mail->From = $correoRemitente;
  17. $mail->FromName = "Logistica CONICO";
  18.  
  19. $mail->Subject = "Encomienda";
  20. $mail->addAddress("p@gmail.com", $nombreCliente);
  21. $mail->addAddress($correoVend, "Ventas");
  22. $mail->addAddress("p@gmail.com", "Confirmación de correo");
  23.  
  24.  
  25. $mail->IsHTML(true);
  26. $body = '<html>
  27. <head>
  28. <meta charset="UTF-8">
  29. </head>
  30. <body style="font-family:Tahoma, Geneva, sans-serif">
  31. <h3>Estimado: '.$nombreCliente.'</h3>
  32. <p>prueba de software conico </p>
  33. <br>
  34. <img height="15%" width="60%" src="../imagenes/FIRMA.png">
  35. </body>
  36. </html>';
  37. $mail->MsgHTML($body);
  38.  
  39. if($mail->Send()){
  40. $msg= "En hora buena el mensaje ha sido enviado con exito a '.$destino.'";
  41. }
  42. else{
  43. $msg = "Lo siento, ha habido un error al enviar el mensaje a $destino";
  44. }
  45.  
  46.  
  47. } catch (Exception $e){
  48.  
  49. echo 'Excepción capturada: ', $e->getMessage(), "n";
  50.  
  51. }
Add Comment
Please, Sign In to add comment