-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail_api.php
More file actions
29 lines (24 loc) · 1017 Bytes
/
email_api.php
File metadata and controls
29 lines (24 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class abc extends CI_Controller {
//controller part
public function send_mails_function(){
$email=''; //receiver address
$subject='';// email subject
$emailContent='';// email content
$this->send_mail($email,$subject,$emailContent);}
public function send_mail($to,$subject, $emailContent) // pass message in HTML page and subject here
{
$from = ''; // Pass here sender mail id
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '60';
$config['smtp_user'] = ''; //Pass here sender mail id
$config['smtp_pass'] = ''; //Pass here sender mail id password
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'html'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not
}
}