Are there alternative programs similar to PHPTriad for setting up a local mail server for testing purposes?

Setting up a local mail server for testing purposes can be done using alternative programs like XAMPP, WampServer, or MAMP. These programs provide a complete stack for running PHP, MySQL, and Apache, and also include the ability to set up a local mail server for testing email functionality.

// Example code snippet using XAMPP to set up a local mail server for testing purposes
// Make sure to configure the SMTP settings in the php.ini file

ini_set("SMTP","localhost");
ini_set("smtp_port","25");

$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email sent from a local mail server.";
$headers = "From: sender@example.com";

mail($to, $subject, $message, $headers);