Advertisement
rahendz

Sending Mail via PHP

Sep 12th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. function kirim_email(){
  2.     ini_set('SMTP', "smtp.googlemail.com");
  3.     ini_set('smtp_port', "465");
  4.     ini_set('sendmail_from', "masbott@gmail.com");
  5.     ini_set('display_error', '1');
  6.  
  7.     $to = 'Rahendra Putra <rahendz@gmail.com>';
  8.     $message = 'Message';
  9.  
  10.     $subject = 'Kapan rabi neh?';
  11.     $body    = "<div> hi hi .. </div>";
  12.     $headers = "MIME-Version: 1.0\r\n";
  13.     $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  14.     $headers .='X-Mailer: PHP/' . phpversion();
  15.     $headers .= "Date: ".date('Y-m-d')."\r\n";
  16.     $headers .= "X-Sender: Fakhrur <masbott@gmail.com>\n";
  17.     $headers .= "Return-Path: masbott@gmail.com\n";
  18.     $headers .= "Mailed-by: uad.ac.id\r\n";
  19.     $headers .= "Signed-by: uad.ac.id\r\n";
  20.     $headers .= "From: masbott@gmail.com" . "\r\n";
  21.  
  22.     mail($to,$subject,$message, $headers);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement