The Joomla API makes this very easy with the JMail class.
You can learn more about the JMail class here.
1. The global mail object (JMail) is fetched through the JFactory object:
2. We set the sender of the email with the function setSender. The site email address and name are fetched from the global configuration:
3. The recipient is set with the function addRecipient.
For multiple recipients you can use an array:
4. The subject is set with the function setSubject. You can add a message to the mail body with the function setBody. If you want to attach a file you can use the function addAttachment:
Optionally you can format your email in HTML using the function IsHTML. If you want to embed an image you can use the function AddEmbeddedImage:
5. Finally you can send the email with the function Send: