FGF-College-Work / Forum

:beer: Espaço dedicado a discussões e tira dúvida sobre disciplinas e conteúdo tecnológico.
MIT License
13 stars 4 forks source link

Send Email in CodeIgniter With SMTP #187

Open marcialwushu opened 5 years ago

marcialwushu commented 5 years ago

Load CodeIgniter’s Email Class

First, load the CodeIgniter’s email library through the following code snippet:

$this->load->library('email');

Set Email Parameters

The next step is to setup the required fields for the custom email. these fields could be setup through several functions including: from() function takes two parameters – the email address of the sender and the name. to() function takes the email address of the recipient. Next two functions are subject() and message() that round up the requirements for sending emails in CodeIgniter. Here is how these functions are used in the code:

$this->email->from('email@example.com', 'Identification');
$this->email->to('emailto@example.com');
$this->email->subject('Send Email Codeigniter');
$this->email->message('The email send using codeigniter library');
marcialwushu commented 5 years ago

https://www.cloudways.com/blog/send-email-codeigniter-smtp/

marcialwushu commented 5 years ago

mail

(PHP 4, PHP 5, PHP 7)

mail — Send mail

Description ¶

mail ( string $to , string $subject , string $message [, mixed $additional_headers [, string $additional_parameters ]] ) : bool

Sends an email.


PHP.NET

marcialwushu commented 5 years ago

https://github.com/ivantcholakov/codeigniter-phpmailer/blob/master/libraries/MY_Email_3_0_x.php