For some reason the php mail() function is not working properly on a site I am building. I tried to troubleshoot the issue down to its simplest form, and came up with this file:
<?php
mail('[email protected]', 'the subject', 'the message', 'From: [email protected]', '[email protected]');
?>
when myEmail is a Gmail account, I never receive the message. However when I use a non-gmail account, I do receive the message. I am at a loss and have tried everything to figure this out. I am starting to think it is an obscure host/server issue. You can see the server specs here: http://aopmfg.com/php.php
Any ideas?
EDIT - let me also add that this was all working fine a few weeks ago, the last time I tested it. No significant code changes since then at all.
EDIT 2 - After reading a similar post I tried adding From and Reply-To headers... still no luck. New code:
<?
$headers = 'From: <[email protected]>' . "
" .
'Reply-To: <[email protected]>';
mail('<[email protected]>', 'the subject', 'the message', $headers,
'[email protected]');
?>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…