Advertisement
GWibisono

kirim email pake smtp

Nov 18th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. require_once("Mail.php");
  3.     require_once('Mail/mime.php'); 
  4. $recipients =  "gundambison@gmail.com";
  5.     $headers["From"] = 'noreply@xxxx.com';
  6.     $headers["Return-Path"] = 'noreply@xxxx.com';
  7.     $headers["To"] = "xxxxx@gmail.com";
  8.     $headers["Subject"] = "menerima order pemesanan";
  9.  
  10. $mime = new Mail_mime($crlf);  
  11.         $mime->setHTMLBody($pesan);
  12.         $body = $mime->get();
  13.         $header  = $mime->headers($headers);
  14.      
  15.     $smtpinfo["host"] =  "mail.xxxxx.com";
  16.     $smtpinfo["port"] = "25";
  17.     $smtpinfo["auth"] = true;
  18.     $smtpinfo["username"] = "noreply@xxxxx.com";
  19.     $smtpinfo["password"] = "xxxx";
  20.      
  21.     $mail_object =& Mail::factory("smtp", $smtpinfo);
  22. $mail_object->send($recipients, $header, $body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement