In this example, the add_submit function is called when the user clicks the Send button. The script uses PHP's mail function to send the form data as an email to the contact@example.com email address. If the email is sent successfully, the script will display a thank you message, otherwise it will display an error message. Package library: This code example does not require any package library.