$to = "recipient@example.com"; $subject = "Test email"; $message = "This is a test email."; $headers = "From: sender@example.com\r\n"; mail($to, $subject, $message, $headers);
$to = "recipient1@example.com, recipient2@example.com"; $subject = "Test email"; $message = "This is a test email."; $headers = "From: sender@example.com\r\n"; mail($to, $subject, $message, $headers);In this example, the setReceiptor function is used implicitly as the $to variable specifies multiple recipients separated by a comma. Package library: PHP's built-in mail function does not require any external package or library.