Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function mailku($pekerja) {
- $tgl = date("d-m-Y H-s");
- $user = $this->session->userdata('NAMA');
- $mail = $this->phpmailerlib->load();
- $mail->SMTPDebug = 2; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'gema.saputera9@gmail.com'; // SMTP username
- $mail->Password = 'evilrose09'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- //Recipients
- $mail->setFrom('gema.xavier@gmail.com', 'SOLID System | PGN');
- $mail->addReplyTo('gema.saputera@gmail.com', 'Gema');
- //$mail->addCC('cc@example.com');
- //$mail->addBCC('bcc@example.com');
- //Attachments
- //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = '[SOLID System] Penambahan pekerja baru pada '.$tgl.'';
- $mail->Body = '<!DOCTYPE html>
- <head>
- <title>[Penambahan Pekerja Baru]</title>
- </head>
- <body>
- <div style="width:100%; height:auto; padding:0px 150px; background-color:#eee;">
- <div>
- <table>
- <tbody>
- <tr style="justify-content: space-around;min-height: 70px;text-align:center;background-color:#fff;min-width: 10rem; padding:25px 100px ;" ><img width="20" src="http://3.bp.blogspot.com/-B_60B16vKDQ/UAgay8TAEeI/AAAAAAAAGK8/DdP92Mqy3Fc/s400/LOGO+BARU+PGN.png"></tr>
- <tr style="min-height:60px;">Nama Pekerja : '.$pekerja.'</tr>
- </tbody>
- </table>
- <div>
- </div>
- </body>
- </html>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->addAddress('gema.xavier@gmail.com', $user);
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement