I'm trying to send and email from a custom add-on using the Email Class and having no luck at all. I'm not totally sure how to debug this, as I've not got any server errors or anything like that.
This is the code I'm using as per the Docs:
$this->EE->load->library('email');
$this->EE->load->helper('text');
$this->EE->email->initialize();
$this->EE->email->wordwrap = true;
$this->EE->email->mailtype = 'text';
$this->EE->email->from($this->from_address);
$this->EE->email->to($receipient);
$this->EE->email->subject($subject);
$this->EE->email->message(entities_to_ascii($email_msg));
$this->EE->email->Send();
Are there any special requirements with regard to permissions I should be adding? I've created a separate user in order to post to a specific channel and then send notification emails.
I'm working locally at the moment and I've tried sending an email from the CP and that worked out ok, so I guess my email config is all right. I was logged in as the admin though.
Any help gratefully received.