Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. require 'phpmailertesting/PHPMailerAutoload.php';
  2.  
  3. $mail = new PHPMailer;
  4.  
  5. //$mail->SMTPDebug = 3; // Enable verbose debug output
  6.  
  7. $mail->isSMTP(); // Set mailer to use SMTP
  8. $mail->Host = 'send.one.com'; // Specify main and backup SMTP servers
  9. $mail->SMTPAuth = true; // Enable SMTP authentication
  10. $mail->Username = 'myemailhidden'; // SMTP username
  11. $mail->Password = 'mypasswordhidden'; // SMTP password
  12. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  13. $mail->Port = 465; // TCP port to connect to
  14.  
  15. $mail->From = 'myemailhidden';
  16. $mail->FromName = 'My Name';
  17. $mail->addAddress('example@example.com'); // Name is optional
  18.  
  19. $mail->addCC('cc@example.com');
  20. $mail->addBCC('bcc@example.com');
  21.  
  22. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  23. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  24. $mail->isHTML(true); // Set email format to HTML
  25.  
  26. $mail->Subject = 'Here is the subject';
  27. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  28. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  29.  
  30. if(!$mail->send()) {
  31. echo 'Message could not be sent.';
  32. echo 'Mailer Error: ' . $mail->ErrorInfo;
  33. } else {
  34. echo 'Message has been sent';
  35. }
  36.  
  37. $mail->isSMTP(); // Set mailer to use SMTP
  38. $mail->Host = 'mailout.one.com'; // Specify main and backup SMTP servers
  39. $mail->SMTPAuth = false; // Authentication must be disabled
  40. $mail->Username = 'myemailhidden';
  41. $mail->Password = ''; // Leave this blank
  42. $mail->Port = 25; // TCP port to connect to
  43.  
  44. $mail->isSMTP();
  45. $mail->Host = 'mailout.one.com';
  46. $mail->SMTPAuth = false; // disable SMTP authentication
  47. $mail->Username = '[your one.com-email]';
  48. $mail->Password = '[your one.com-email password]';
  49. $mail->SMTPSecure = ''; // leave this blank!
  50. $mail->Port = 25;
  51.  
  52. <?php
  53.  
  54. require 'PHPMailerAutoload.php';
  55.  
  56. $mail = new PHPMailer;
  57. //$mail->SMTPDebug = 3;
  58. $mail->isSMTP();
  59. $mail->Host = "mailout.one.com";
  60. $mail->SMTPAuth = false;
  61. $mail->Port = 25;
  62. $mail->From = 'your@domain.se';
  63. $mail->FromName = 'Mailer';
  64. $mail->addAddress('sendtothis@domain.se');
  65. $mail->addReplyTo('ireply@domain.se', 'Information');
  66. $mail->addBCC('bcc@example.com');
  67. $mail->isHTML(true);
  68. $mail->Subject = 'Here is the subject';
  69. $mail->Body = 'hejehej';
  70. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  71. if(!$mail->send()) {
  72.  
  73. echo 'Message could not be sent.';
  74. //echo 'Mailer Error: ' . $mail->ErrorInfo;
  75.  
  76. } else {
  77.  
  78. echo 'Message has been sent, ja e fan inte tom';
  79.  
  80. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement