I need to test some script using PHP\'s mail. I\'d like to be able to finally get this working locally. I am using MAMP. Is there a way to do this without installing any thi
Few months ago I had a similar problem whilst developing on my local machine an application which involved sending automating email notifications. I have lost quite some time installing Sendmail on OSX and eventually I could not get it working right..
My approach was to use the PEAR Mail as a temporary replacement for php's native mail function. Basically you can define a function called send-mail (see code below) and, once you deploy your app on a server, you can possibly replace the calls to that function with calls to mail().
"Your agent ",
'To' => $recipient,
'Subject' => $subject
);
$smtp = Mail::factory(
'smtp',
array ('host' => $host,
'auth' => true,
'port' => $port,
'username' => $username,
'password' => $password)
);
$smtp->send($recipient, $headers, $body);
}
?>