Advertisement
Guest User

Untitled

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