Much work should be added to this example to make a real world application of it, such as adding better security and error support.
An easy to add security measure would be to use the
This class can help us check if we are using a proper e-mail, or check that no headers have been injected in the subject, body, and so on.
For example, in our module, if we want to check that no headers have been injected
in our body, we could do it like this. The following excerpt is from the
jimport('joomla.mail.helper'); $body = JMailHelper::cleanText($body); $mail->setBody($body);
First we import the helper class, then we use the