PHP mail function and BCC


I have a website for a client which allows them to email their users, which is handled using PHP’s mail function and a BCC header. This works on the tests I’ve done to a few addresses but the client doesn’t think it’s working when sending to all their customers (just over 2000).

I’ve read about the limit of 998 characters on any one line but does this apply to headers too and is it still relevant?

I’m also wondering if there’s a limit to the number of addresses that can be included in a BCC field but googling hasn’t really given me an answer.

Does anyone have any thoughts/advice on this? I’m going to ask the ISP if there’s a limit on sending mail too in case that’s the problem.



Well most of the time - even if returned true - mail fails due to headers.

Why not use something already tested and tried like PHPMailer with the isSMTP() option.

Most hosting providers will have some sort of limit on the number of emails that can be sent in a given period. Sending 2000 emails all at once is almost certainly going to exceed those limits.

OK, thanks. I had been considering using something like PHPMailer but seeing as I’ve not used it before I was hoping there’d be a simple answer :slight_smile:

So will there not be the same restriction on the number of emails sent at one time when using PHPMailer? And is it easy to use?

If your hosting provider limits the number of emails you can send in a given period then all emails sent in that time count toward the total regardless of how you create them.

Each To: CC: and BCC: address counts as another email to be sent regardless of whether they are all sent at once or sent separately.