I was testing out my mail configuration. First I did a normal mail() call in a separate .php file. That worked fine. Then I copied the exact same code inside a route callback in Laravel 4 and now it doesn't work. How is that possible?
This is the code that works:
$from_add = "name@your-web-site.com";
$to_add = "someone@gmail.com"; //<-- put your yahoo/gmail email address here
$subject = "Test Subject";
$message = "Test Message";
$headers = "From: $from_add
";
$headers .= "Reply-To: $from_add
";
$headers .= "Return-Path: $from_add
";
$headers .= "X-Mailer: PHP
";
mail($to_add,$subject,$message,$headers);
The adresses don't matter because I am testing with Test Mail Server Tool