I'm very new to php and am trying to test the mail() function locally. I'm using Homestead/Laravel as a local server. My php.ini file only has one line, where I turn debugging on. Any Homestead/Laravel people out there know how to edit my files so that I can test email locally? Note: I added echo in front of the mail funciton to see if it was working at all.
<?php
$emailTo = "[email protected]";
$subject = "Testing out PHP";
$body = "Huzzah";
$headers = "From: [email protected]";
echo mail($emailTo, $subject, $body, $headers);
?>
Use:
the log driver
In
project/config/mail.php, set the mail driver tolog:'driver' => env('MAIL_DRIVER', 'log'),then check your log files for the emails:
project/storage/logs/*.log
a universal to-address (and send everything to yourself)
a dummy mailbox
Check this link for more information: http://laravel.com/docs/5.1/mail#mail-and-local-development
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With