Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @url GET sendMail
- * @param string $email
- * @return bool
- */
- public function sendMail($email)
- {
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'email-smtp.eu-west-1.amazonaws.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'AKIAIKXC42JFQ65DPYHQ'; // SMTP username
- $mail->Password = 'Ajsb+uSBHhl21ITdX/vs0Mw8UH0Cq81tJudfEMS7FbL9 '; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 25; // TCP port to connect to
- $mail->setFrom('neverendingstories@nes.com', 'Mailer');
- $mail->addAddress("$email", 'Jose'); // Add a recipient
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Confirme a conta!';
- $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'>
- <head>
- <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
- <title>Demystifying Email Design</title>
- <meta name='viewport' content='width=device-width, initial-scale=1.0'/>
- </head>
- <body style='margin: 0; padding: 0;'>
- <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;'>
- <tr>
- <td align='center' bgcolor='#e2f1f9' style='padding: 0 0 0 0;'>
- <img src='nes3.png' alt='Never Ending Stories' width='220' height='89' style='display: block;' />
- </td>
- </tr>
- <tr>
- <td bgcolor='#fff' style='padding: 30px 30px 10px 30px;'>
- <table border='0' cellpadding='0' cellspacing='0' width='100%' >
- <tr>
- <td>
- <b>Bem-vindo ao Never Ending Stories!</b>
- </td>
- </tr>
- <tr>
- <td style='padding: 40px 0 20px 0;'>
- Para concluir o seu registo por favor confirme a sua conta:
- </td>
- </tr>
- <tr>
- <td style='padding: 0 0 30px 0;'>
- <a href='https://nestories.com/confirm_email/12uhrYr20A' class='myButton' style='-moz-box-shadow: 0 1px 0 0 #f0f7fa;
- -webkit-box-shadow: 0 1px 0 0 #f0f7fa;
- box-shadow: 0 1px 0 0 #f0f7fa;
- background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2));
- background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%);
- background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%);
- background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%);
- background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%);
- background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%);
- background-color:#33bdef;
- -moz-border-radius:6px;
- -webkit-border-radius:6px;
- border-radius:6px;
- border:1px solid #057fd0;
- display:inline-block;
- cursor:pointer;
- color:#fff;
- font-size:15px;
- font-weight:bold;
- padding:6px 24px;
- text-decoration:none;
- text-shadow:0 -1px 0 #5b6178;'>Confirmar conta</a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table align='center' border='0' cellpadding='0' cellspacing='0' width='600' style='color: #153643; font-family: Arial, sans-serif; font-size: 11px'>
- <tr>
- <td bgcolor='#fff' style='padding: 5px 0 0 32px;'>
- Never Ending Stories, UA - DeCA 3810-193 Aveiro Portugal
- </td>
- </tr>
- </table>
- </body>
- </html>";
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement