Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. //$mail->SMTPDebug = 3; // Enable verbose debug output
  7.  
  8. $mail->isSMTP(); // Set mailer to use SMTP
  9. $mail->Host = 'email-smtp.eu-west-1.amazonaws.com'; // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true; // Enable SMTP authentication
  11. $mail->Username = 'AKIAIKXC42JFQ65DPYHQ'; // SMTP username
  12. $mail->Password = 'Ajsb+uSBHhl21ITdX/vs0Mw8UH0Cq81tJudfEMS7FbL9 '; // SMTP password
  13. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  14. $mail->Port = 25; // TCP port to connect to
  15.  
  16.  
  17. function sendMail()
  18. {
  19. $mail = new PHPMailer;
  20. $mail->setFrom('neverendingstories@nes.com', 'Mailer');
  21. $mail->addAddress('jose.mario@ua.pt', 'Jose'); // Add a recipient
  22.  
  23. $mail->isHTML(true); // Set email format to HTML
  24.  
  25. $mail->Subject = 'Confirme a conta!';
  26.  
  27. $mail->Body = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'>
  28. <head>
  29. <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
  30. <title>Demystifying Email Design</title>
  31. <meta name='viewport' content='width=device-width, initial-scale=1.0'/>
  32. </head>
  33.  
  34. <body style='margin: 0; padding: 0;'>
  35.  
  36. <table align='center' border='1' cellpadding='0' cellspacing='0' width='600' style='color: #153643; font-family: Arial, sans-serif; font-size: 14px; border-color:#fff;'>
  37. <tr>
  38. <td align='center' bgcolor='#e2f1f9' style='padding: 0 0 0 0;'>
  39. <img src='nes3.png' alt='Never Ending Stories' width='220' height='89' style='display: block;' />
  40. </td>
  41. </tr>
  42. <tr>
  43. <td bgcolor='#fff' style='padding: 30px 30px 10px 30px;'>
  44. <table border='0' cellpadding='0' cellspacing='0' width='100%' >
  45. <tr>
  46. <td>
  47. <b>Bem-vindo ao Never Ending Stories!</b>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td style='padding: 40px 0 20px 0;'>
  52. Para concluir o seu registo por favor confirme a sua conta:
  53. </td>
  54. </tr>
  55. <tr>
  56. <td style='padding: 0 0 30px 0;'>
  57. <a href='https://nestories.com/confirm_email/12uhrYr20A' class='myButton' style='-moz-box-shadow: 0 1px 0 0 #f0f7fa;
  58. -webkit-box-shadow: 0 1px 0 0 #f0f7fa;
  59. box-shadow: 0 1px 0 0 #f0f7fa;
  60. background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2));
  61. background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%);
  62. background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%);
  63. background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%);
  64. background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%);
  65. background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%);
  66. background-color:#33bdef;
  67. -moz-border-radius:6px;
  68. -webkit-border-radius:6px;
  69. border-radius:6px;
  70. border:1px solid #057fd0;
  71. display:inline-block;
  72. cursor:pointer;
  73. color:#fff;
  74. font-size:15px;
  75. font-weight:bold;
  76. padding:6px 24px;
  77. text-decoration:none;
  78. text-shadow:0 -1px 0 #5b6178;'>Confirmar conta</a>
  79. </td>
  80. </tr>
  81. </table>
  82. </td>
  83. </tr>
  84. </table>
  85. <table align='center' border='0' cellpadding='0' cellspacing='0' width='600' style='color: #153643; font-family: Arial, sans-serif; font-size: 11px'>
  86. <tr>
  87. <td bgcolor='#fff' style='padding: 5px 0 0 32px;'>
  88. Never Ending Stories, UA - DeCA 3810-193 Aveiro Portugal
  89. </td>
  90. </tr>
  91. </table>
  92. </body>
  93.  
  94. </html>";
  95.  
  96. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  97.  
  98. if(!$mail->send()) {
  99. echo 'Message could not be sent.';
  100. echo 'Mailer Error: ' . $mail->ErrorInfo;
  101. } else {
  102. echo 'Message has been sent';
  103. }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement