Advertisement
GWibisono

smtp

Jul 23rd, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. /*
  3. alternatif selain mail. sy taro di helper
  4. */
  5. require_once("Mail.php");
  6.     require_once('Mail/mime.php'); 
  7.     $recipients =  $a['to'];
  8.     $headers["From"] = $a['from'];
  9.     $headers["Return-Path"] = $a['from'];
  10.     $headers["To"] = $a['to'];
  11.     $headers["Subject"] = $a['subject'];
  12.     $crlf = "\n";  
  13.     $mailmsg=$a['msg'];
  14.         $mime = new Mail_mime($crlf);  
  15.         $mime->setHTMLBody($mailmsg);
  16.         $body = $mime->get();
  17.         $header  = $mime->headers($headers);
  18.  //"174.136.35.84";
  19.     $smtpinfo["host"] =  "mail.xxx.com";
  20.     $smtpinfo["port"] = "25";
  21.     $smtpinfo["auth"] = true;
  22.     $smtpinfo["username"] = "cs@xxxx.com";
  23.     $smtpinfo["password"] = "xxxxxx";
  24.      
  25.     $mail_object =& Mail::factory("smtp", $smtpinfo);  
  26.     $mail_object->send($recipients, $header, $body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement