title: php - detect if email is sent
body: <p>Im building an automated newsletter, im kinda stuck with this problem.
  I need to know if the email was sent or not. Here is my code</p>
  
  <pre><code> @$send = mail($emailRecipient, $subject, $message, $headers);
  </code></pre>
  
  <p>i tried to add it to an if statement but it does not work here is the code.</p>
  
  <pre><code>if( @$send = mail($emailRecipient, $subject, $message, $headers)){
     //do something
  }else{
    //do something
  }
  </code></pre>