I have Wordpress installed locally with Xampp. For testing purposes, I need to be able to send and receive transactional emails. I've spent 3 days trying the get my local server to send emails (and trying the plugins Wp Mail SMTP as well as Sendinblue), without any sucess. I've heard emails from localhost are often blocked by email providers and notoriously unreliable.
It would greatly simplify my life if I could just save an email locally, by sending it to a file, without needing to send it to a real webmail.
Any advice? (by the way, I'm working on a Mac, but in any case any advice at all would be greatly appreciated)
Many thanks!
EDIT:
I can't get mailtrap to work either. When I paste their code into functions.php:
function mailtrap($phpmailer) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.mailtrap.io';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 2525;
$phpmailer->Username = 'xxxxxxxxxxxxx';
$phpmailer->Password = 'xxxxxxxxxxxxx';
}
add_action('phpmailer_init', 'mailtrap');
then I make a PHP file and try to send an email like this:
$to = "bviatte@gmail.com";
$subject = 'my subject';
$message = 'I would like to work with you';
$headers[] = 'From: Ben<bviatte@gmail.com>';
$sent_message = wp_mail( $to, $subject, $message, $headers);
var_dump($sent_message); // i get boolean false here.
if ( $sent_message ) {
echo 'The test message was sent. Check your email inbox.';
} else {
echo 'The message was not sent!'; //this gets printed in d end.
}
?>
I get a boolean false error message...