Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » SMTP CI Sendmail

SMTP CI Sendmail

Di Controller ditambahkan ini

function sendmail($email,$Judul,$IsiBerita){
$arraymail= array(
‘protocol’ =>’smtp’,
‘smtp_host’=>’192.168.11.252′,
‘smtp_port’=>’25’,
‘smtp_user’=>’eproc@ptpn-11.com’,
‘smtp_pass’=>’rahasia’
/*
‘protocol’ => ‘smtp’,
‘smtp_host’=>’ssl://smtp.gmail.com’,
‘smtp_port’=>’465′,
‘smtp_user’=>’ptpn11sender@gmail.com’,
‘smtp_pass’=>’rahasiakita’
*/

/*
‘smtp_host’=>’http://192.168.11.25′,
‘smtp_port’=>’25’,
‘smtp_user’=>’eproc@ptpn-11.com’,
‘smtp_pass’=>’rahasia’
*/
);
$this->load->library(‘email’,$arraymail);
$this->email->set_newline(“\r\n”);

$this->email->from(‘eproc@ptpn-11.com’,’Eproc PTPN-XI’);
$this->email->to($email);
$this->email->subject($Judul);
$this->email->message($IsiBerita);

Di Library ditambahkan ini /system/libraries/Email.php

ini Filenya Email.php

var $useragent = “CodeIgniter”;
var $mailpath = “/usr/sbin/sendmail”; // Sendmail path
var $protocol = “mail”; // mail/sendmail/smtp
var $smtp_host = “192.168.11.252”; // SMTP Server. Example: mail.earthlink.net
var $smtp_user = “eproc@ptpn-11.com”; // SMTP Username
var $smtp_pass = “rahasia”; // SMTP Password
var $smtp_port = “25”; // SMTP Port
var $smtp_timeout = 5; // SMTP Timeout in seconds
var $smtp_crypto = “”; // SMTP Encryption. Can be null, tls or ssl.
var $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off
var $wrapchars = “76”; // Number of characters to wrap at.
var $mailtype = “text”; // text/html Defines email formatting
var $charset = “utf-8″; // Default char set: iso-8859-1 or us-ascii
var $multipart = “mixed”; // “mixed” (in the body) or “related” (separate)

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>