Smtp configuration
edit config/config.ini
[ActionMailer] address = mail.example.com port = 25 domain = example.com user_name = admin@example password = user_password ttl = false
Code
setting basic header
$this->Mail->to('"USER NAME" ');
$this->Mail->from('"USER NAME" ');
$this->Mail->subject("SUBJECT");
adding attachments
$this>Mail->attachment(DIR_PUBLIC . 'file.txt'); $this>Mail->attachment(DIR_PUBLIC . 'another_file.txt');
setting body
$body = $this->render_to_string('/notifier/registration');
$this->Mail->plain($body);
or
$this->Mail->html($body);
or
$this->Mail->body($body);
send an email
$this->Mail->send();
