Where are sent email messages stored when sent using PHP's mail()?

When I use the PHP mail() function to send mail, are the sent messages stored somewhere? How can I tell if the mails were really sent? For example, on my GoDaddy server I exceeded the daily limit of mails that can be sent and I only found out by accident.
Thanks
tr5
tr5Asked:
Who is Participating?
 
TeRReFConnect With a Mentor Commented:
Well, using a Bcc header will send you an email as well which will have the same result as saving the send emails. To be notified of any failures, you will need the from/ reply-to header(s) to make sure that any failures are reported back to you.

You can send extra headers with the fourth parameter in mail(). So, something like this:

$headers = 'From: youremail@yourserver.com' . "\r\n" .
                    'Bcc: youremail@yourserver.com';

if (mail($email, $subject, $body, $headers) === false))
  die('Error while sending mail');
0
 
TeRReFCommented:
As far as I know the emails are not stored. If you put a valid email in the from header, you'll receive a failure notification when emails didn't reach their destination (you can also add a Bcc header to achieve the same without having to adjust uyour from header)
0
 
TeRReFCommented:
Of course, mail() itself returns false if the sending fails..
0
 
tr5Author Commented:
Is there a way to configure PHP or sendmail or both to store the mails or a keep a record somehow?
What do you mean by "adding a BCC header"?
0
All Courses

From novice to tech pro — start learning today.