Mail¶
mail() is the PHP native function that sends emails. It is a relay to system commands that actually send the mail.
mail() does not provide support to structure mail, in particular attachements. This is left to custom components, such as PHPMailer.
<?php
$message = World;
mail('contact@php.net', 'Hello!', $message);
?>
See also Guide: How to send emails in PHP (with examples) and PHP mail() function: how to send email in PHP safely.
Related : Simple Mail Transfer Protocol (SMTP)
Related packages : phpmailer/phpmailer