Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6.  
  7. $mail->isSMTP(); // Set mailer to use SMTP
  8. $mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP serv
  9. $mail->SMTPAuth = true; // Enable SMTP authentication
  10.  
  11. $mail->Username = 'user@example.com'; // SMTP username
  12. $mail->Password = 'secret'; // SMTP password
  13. $mail->SMTPSecure = 'tls'; // Enable TLS encryption,
  14. $mail->Port = 587; // TCP port to connect to
  15.  
  16. $mail->setFrom('from@example.com', 'Mailer');
  17. $mail->addAddress('joe@example.net', 'Joe User'); //El correo por ahora es uno
  18.  
  19. $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  20.  
  21.  
  22. $mail->Subject = 'Here is the subject'; //Estos datos cambian
  23. $mail->Body = 'This is the HTML message body <b>in bold!</b>'; //Datos cambian
  24.  
  25. if(!$mail->send()) {
  26. echo 'Message could not be sent.';
  27. echo 'Mailer Error: ' . $mail->ErrorInfo;
  28. } else {
  29. echo 'Message has been sent';
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement