473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail() is eating my bcc: header

Dear all

I have a script (below) that for a long time has been sending out to an
opt-in distribution list, about 100 members. Today it has stopped working
and I am not quite sure what I have changed. This is the smallest version
that still demonstrates the problem (addresses obviously changed from the
real ones):

$subject = 'Small test';

$sender = 'm*******@example.com';

$contents = "This is a short test message";
$recips = "1@example.com";
$recips .= ",\r\n 2@example.com";
$recips .= ",\r\n 3@example.com";
$recips .= ",\r\n 4@example.com";

$header='From: ' . $sender . "\r\nX-mailer: php mail()" .
"\r\nbcc: " . $recips;

echo("<h4>Header string:</h4><pre>$header</pre>");

$success = mail($sender, $subject, $contents, $header);
The symptom is that the entire "bcc: 1@example.com" line disappears,
leaving the other three addresses tacked onto the X-mailer header. Prior
to putting in that dummy line, they were attached to the To: header,
which is not much use.

If I change the Bcc: to cc: (i.e. remove just one character) then it
formats and sends perfectly as expected -- but of course, all the
addresses are visible.

I don't think it is the ISP (Linux, shared web hosting) because it
happens on my own Windows test server. Looking at my server's firewall
log, the mangling has already happened on the way out to the smtp server.

I have tried all the ways I can think of to create the $header string,
but all with the same outcome. There is no function or variable called
Bcc that could be causing substituting.

I can't think of anything I've done. Help please?

Tim F

Jan 15 '07 #1
2 2513
I have tried all the ways I can think of to create the $header string,
but all with the same outcome. There is no function or variable called
Have you also tried to make a simple test header string without any string
concanations and variables?
Because often we can be so sure, that our variable is something that it is
not.

Options imho:

a) your string is not want you think it is
b) the way you believe that string should be build for mail()-function is
wrong
c) more mysterious server reason

Jan 16 '07 #2
"P Pulkkinen" <pe*************************@POISTATAMA.elisanet.f iwrote
in news:jU*****************@reader1.news.saunalahti.f i:
>
>I have tried all the ways I can think of to create the $header
string, but all with the same outcome. There is no function or
variable called

Have you also tried to make a simple test header string without any
string concanations and variables?
Yes: I can send it with all the bcc addresses on a single line and it goes
out correctly to all four addresses.
Because often we can be so sure, that our variable is something that
it is not.
That is the reason for the echo("<pre>$header</pre>"); line.
Options imho:

a) your string is not want you think it is
Possible, but I can't see what else it could be.
b) the way you believe that string should be build for mail()-function
is wrong
As far as I can tell, it's RFC conformant. There is no way I can put all
100 addresses on one line.
c) more mysterious server reason
My server reports that this one file is encoded as UTF-8 rather than ISO-
8859-1 (which all the other pages on the same site are) but I don't know if
I am now chasing ghosts.

Thanks anyway

Tim F

Jan 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3313
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
1
2386
by: praba kar | last post by:
Dear All, I am new to python world. I have pasted my code which I used it to build rfc822 format mails for webbased mailing system task(which is like to yahoo.com web interface). Now I am...
4
1349
by: yoelgold | last post by:
$msubject = "Price Change"; $tomail = "yoelg...@yahoo.com"; $mfrom = "From: Baltimore Trails <i...@baltimoretrails.com>\r\n"; $mbody = "text....asdfasdfasdfasdfasdfa­sdf"; $bcchead1 = "Bcc:...
12
2798
by: Chris Dewin | last post by:
Hi. I've been thinking about using smtplib to run a mailing list from my website. s = smtplib.SMTP("server") s.sendmail(fromaddress, toaddresess, msg) I know that in this instance, the...
3
1397
by: Spr | last post by:
My problem is that code does not execute cariage return in the body message: "<?xml version="1.0"?> <g:propertyupdate xmlns:g="DAV:" xmlns:e="http://schemas.microsoft.com/exchange/"...
4
3881
by: Jason | last post by:
I'm troubleshooting a program that I didn't build, so forgive me on this one. It's called email.php, and it looks like a program that the original developer must have downloaded from somewhere. ...
2
1893
by: bmamo | last post by:
HI, i have a problem similar to this one, but mainly the problem is that my php connects to the mails server, but disconnects immediately. for example: here is the log of the mail server: ...
4
1398
by: Jeff | last post by:
I haven't used php to send mail yet and have some questions. I see that you can add headers, and these days it is essential to have a real "from". But I see you can also do this: ...
1
6128
maliksleo
by: maliksleo | last post by:
hi i am using the following class for email sending but getting this error "Failure sending mail" Imports System.Net.Mail Public Class MailHelper ''' <summary> ''' Sends an mail...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.