0

I tried everything I can but I'm not getting yet the mail in my inbox

<?php
$conn = new PDO("mysql:host=localhost;dbname=xxx", "xxx", "xxx");
$sql="select email from email";
foreach($conn->query($sql, PDO::FETCH_ASSOC) as $simos){
$mail=mail($simos['email'],$_POST['subject'],$_POST['msg']);
echo $simos['email'];
 if($mail){
    echo "success";
} else {
    echo "failed."; 
}

thanks for your help :)

Mohammed Chanaa
  • 93
  • 2
  • 10
  • Check your mailserver logs. It might also be blocked by the recipient's spam filters. – Barmar Nov 08 '18 at 00:20
  • how can I check my mailserver logs (it's my email i'm sending it to and it's not showing even at the spam messages) @Barmar – Mohammed Chanaa Nov 08 '18 at 00:23
  • I'm talking about the log in the machine running the script and sending the mail. It depends on what mailserver software you're running there. – Barmar Nov 08 '18 at 00:32
  • I'm really sorry if I'm a pain for you, but it's my first time doing this.... So I'm not exactly sure what to do... I'm using a Mac OS Mojave , and I'm using mamp. @Barmar – Mohammed Chanaa Nov 08 '18 at 00:34
  • I'm not sure how MAMP configures mail by default. See https://stackoverflow.com/questions/1226299/php-mail-on-mamp – Barmar Nov 08 '18 at 00:41
  • Possible duplicate of [PHP mail function doesn't complete sending of e-mail](https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail) – miken32 Nov 08 '18 at 02:36

0 Answers0