Welcome Guest, Not a member yet? Register   Sign In
Send email
#1

[eluser]maru[/eluser]
Hi everyone!

I have a CRUD "clientes" and I added a button "email", when I click on it I would like to send an email with a username and a password

here is my button

Code:
$crud->add_action('Email', '', 'pendientes/pendientes_v/enviarmail', 'ui-icon-plus');

and then the function

Code:
function enviarmail($id)
    {    
    $this->load->model('email_model', 'email');
    $this->email($id);
    }

then I created a model

Code:
class Email_model extends CI_Controller
{  
     $this->load->library('email');

    $this->email->from('[email protected]', 'Demo');
    $this->email->to('[email protected]');  
    
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');    
    
    $this->email->send();
    
    echo $this->email->print_debugger();

}


but this $this->email->to('[email protected]'); must be a variable because every row has a different email and how can I do to add username and password in the body of this email?

hope can help me, thank u so much in advance!
regards!




Theme © iAndrew 2016 - Forum software by © MyBB