Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // require PEAR:Mail
- require_once("Mail.php");
- // parameter mail
- $host = "ssl://smtp.google.com";
- $port = 465;
- $email = "your_account@gmail.com";
- $pass = "your_gmail_password";
- // buat instance mailer
- $smtp = Mail::factory('smtp',
- array ( 'host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $email,
- 'password' => $pass ) );
- // parameter pngiriman email
- $to = 'aaa@gmail.com';
- $cc = 'bbb@gmail.com';
- $from = 'your_account@gmail.com';
- $headers = array (
- 'From' => $from,
- 'To' => $to,
- 'Cc' => $cc,
- 'Reply-To' => $from,
- 'Date' => date(DATE_RFC822),
- 'Subject' => $subject,
- 'X-Mailer' => 'PHP/'.phpversion(),
- 'MIME-Version' => '1.0',
- 'Content-type' => "text/html; charset='utf-8'",
- 'Content-Transfer-Encoding' => '8bit'
- );
- $recipients = $to.','.$cc;
- $message = 'your message here';
- // kirimkan email
- $mail = $smtp->send($recipients, $headers, $message);
- ?>
Add Comment
Please, Sign In to add comment