Jump to content

Question about email function


Miichael

Recommended Posts

Hello

I have been working on an email routine.  I want to send messages as blind copies so that the end users cannot have access to each others emal addresses.

I am having a problem with the Bcc header.  It seems like I keep running into an upper limit of about 6 or seven email addresses.  Less the messages go thru, more the email function returns an error and nothing is sent.

This is not good because at any given time I will never know how many addresses there are.

Is there a trick to using the function?

My header is:

$this->extra_headers =
(($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') .
(($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") .
"Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8 bit\nDate: " . date('r', time()) . "\n" .
"X-Mailer: PHP \n X-MimeOLE: Produced By phpBB2 \n X-MimeOLE: Originated By Imagine Art Cafe \n" .
(($cc != '') ? "Cc: $cc\n" : '') .
(($bcc != '') ? "Bcc: $bcc\n" : '');

where $bcc is a string of somma seperated email addresses

and the email function is

$result = @mail('Undisclosed-recipients', $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

Thanks

Michael

Link to comment
https://forums.phpfreaks.com/topic/30936-question-about-email-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.