TYPO3 has built in functions for sending e-mails and I would recommend to use the provided classes, since it includes all configuration setup (eg. SMTP auth, correct setting of e-mail headers) which could be configured in TYPO3 install tool.
Usage is quite easy and the example below is taken directly from the Core API documentation
$mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage');
$mail->setFrom(array($email => $name));
$mail->setTo(array($email => $name));
$mail->setSubject($subject);
$mail->setBody($body);
$mail->send();
You should prefer this method over using PHP's mail yourself. The TYPO3 core's implementation (using the SwiftMailer class) implements mailing according to the specification and therefore sends the necessary headers and data to make it highly probable that the e-mail will arrive at most mail servers.