What function do you use in PHP to send an email?
- mail()
- sendmail()
- smtp_send()
- All of the above
In PHP, you can use the mail() function to send an email. The mail() function takes several parameters, including the recipient's email address, the email subject, the email message body, and optional headers. For example, mail($to, $subject, $message, $headers); sends an email using the specified parameters. The mail() function internally uses the underlying mail server configuration to send the email. It is a built-in function in PHP specifically designed for sending emails.
Loading...
Related Quiz
- The fopen() function is used to open a file in PHP.
- What is the purpose of the str_replace() function in PHP?
- What is the purpose of the array_search() function in PHP?
- You have a multidimensional array in your PHP script and you're encountering issues with accessing or manipulating the elements. How would you debug this?
- The break statement in PHP is used to ______ the current loop and move the program control to the line immediately following the loop.