You are here: RE: [PHP] RE: header data being inserted into message « PHP « IT news, forums, messages
RE: [PHP] RE: header data being inserted into message

Posted by "ET Support" on 10/03/30 11:38

Hi Richard,

Thanks for the response, however I do not want to have to use any special
classes or other software... I want to get it working just using the basic
php functions, which should be possible as far as I understand the php
documentation... if I keep finding that I can't get it working then maybe
I'll go to majordomo2.

Anyone else have some advice for me here?

Thanks,
Ben

-----Original Message-----
From: Richard Correia [mailto:php5perl@gmail.com]
Sent: Tuesday, January 17, 2006 12:37 PM
To: ET Support
Cc: php-general@lists.php.net
Subject: Re: [PHP] RE: header data being inserted into message


Hey,

You can use the readymase mailer class from
http://www.weberdev.com/get_example-462.html

and

http://www.weberdev.com/get_example-3724.html

Thanks
Richard


On 1/17/06, ET Support <support@earthtecinc.com> wrote:
Hello all,

I am having a problem using PHP's mail function to send mail via BCC to
multiple recipients. Here's my code;
--------------------------------------
$get_emails = pg_exec($dbh,"SELECT email FROM mailing_list WHERE conf = 1");
$count = pg_numrows($get_emails);
$bcc_count = $envelope_count = 0;
$bcc_limit = 200;
$subject = $body = 'test message';
$from = 'support@earthtecinc.com';
$header = "From: $from\r\n";
for($x = 0; $x < $count; $x++) {
$email = pg_result($get_emails,$x,0);
if($bcc_count >= $bcc_limit) {
if($x > 0) {
$envelope_count++;
mail($from,$subject,$body,$headers);
}
$headers = $header . "Bcc: $email\r\n";
$bcc_count = 1;
} else {
$headers .= "Bcc: $email\r\n";
$bcc_count++;
}
}
# send the last envelope
mail($from,$subject,$body,$headers);
--------------------------------------

The problem is that for some recipients they get a message body like this;

--------------------------------------
Message-Id: < 20060116170640.424CFA51997@earthtecinc.com>
Date: Mon, 16 Jan 2006 17:06:40 +0000 (GMT)

test message
--------------------------------------

Any idea why those headers are being inserted into the message body and how
that can be prevented?

Thanks,
Ben King
support@earthtecinc.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация