Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30101

How to test php mail() function locally on Homestead

$
0
0

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 = "test@gmail.com";
$subject = "Testing out PHP";
$body = "Huzzah";
$headers = "From: test@test.co.uk";

echo mail($emailTo, $subject, $body, $headers);    
?>

Viewing all articles
Browse latest Browse all 30101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>