Beyaz.Net İpucu
Codeigniter smtp mail gönderme
#----------------------------------------------------------------------------------
# Email Gönder
#------------------------------------------------------------------------------
# Email Gönder
private function email_gonder($sTo, $sSubject, $sMessage)
{
$SMTP_HOST = "xxxxxxxxx";
$SMTP_USER = "xxxx@xxxx.com.tr";
$SMTP_PASS = "xxxx";
$SMTP_PORT = "587";
$this->load->library('email');
// Set the default email config and Initialize
$config['protocol'] = 'smtp';
$config['smtp_host'] = $SMTP_HOST;
$config['smtp_user'] = $SMTP_USER;
$config['smtp_pass'] = $SMTP_PASS;
$config['smtp_port'] = $SMTP_PORT;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from('ozgur@artkim.com.tr', 'Artkim');
$this->email->to($sTo);
$this->email->subject($sSubject);
$this->email->message($sMessage);
//if( !$this->CI->email->send())
if( !$this->email->send())
{
//echo $this->email->print_debugger();
return -1;
}
else
{
//echo "Email sent";
return 1;
}
}
}
# Email Gönder
#------------------------------------------------------------------------------
# Email Gönder
private function email_gonder($sTo, $sSubject, $sMessage)
{
$SMTP_HOST = "xxxxxxxxx";
$SMTP_USER = "xxxx@xxxx.com.tr";
$SMTP_PASS = "xxxx";
$SMTP_PORT = "587";
$this->load->library('email');
// Set the default email config and Initialize
$config['protocol'] = 'smtp';
$config['smtp_host'] = $SMTP_HOST;
$config['smtp_user'] = $SMTP_USER;
$config['smtp_pass'] = $SMTP_PASS;
$config['smtp_port'] = $SMTP_PORT;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from('ozgur@artkim.com.tr', 'Artkim');
$this->email->to($sTo);
$this->email->subject($sSubject);
$this->email->message($sMessage);
//if( !$this->CI->email->send())
if( !$this->email->send())
{
//echo $this->email->print_debugger();
return -1;
}
else
{
//echo "Email sent";
return 1;
}
}
}