|
|
|
06-16-1999, 03:35 PM
|
Postid: 43195
|
|
Registered User
Join Date: Mar 1999
Location: Seattle, WA
Posts: 1,059
|
Making a BCC
Oh, I've fallen in LOVE with PHP...
Right now I'm playing with the mail() function... I'm trying to send out ONE mail to five different people. It would REALLY be nice if I could just slip in a BCC header, but it seems I can't actually create one... Or if I am creating it properly, my mail server doesn't like it one bit Setting the header to "From: $MyAddress\nBcc: $AddyOne\nBcc: $AddyTwo" and so on....
Would it be easier just to call the function five different times, or would it be easier to BCC? If BCC, how would I do that? *L*
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
|
|
|
06-16-1999, 05:03 PM
|
Postid: 43196
|
|
CTO FutureQuest, Inc.
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,683
|
Off the top of my head, try using commas ',' instead of '\n' to separate the addies...
--
Terra
--What? me liable!--
FutureQuest
|
|
|
06-16-1999, 05:21 PM
|
Postid: 43197
|
|
Registered User
Join Date: Mar 1999
Location: Seattle, WA
Posts: 1,059
|
No luck. It doesn't seem to like a single BCC either... I'm NOT using the FQ mail server, should I try and see if it makes a difference?
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
|
|
|
06-16-1999, 05:44 PM
|
Postid: 43198
|
|
Visitor
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
|
I don't believe that BCC is part of the ordinary header (not sure though) because the header is viewable to the recipient - where BCC is supposed to be blind. I think BCC is something only used in an email client - it does the multiple emails manually (correct me if I'm wrong, as I probably am).
To do a normal CC, you can do this:
mail ("person1@host.com person2@otherhost.com blah@hehe.net", "Subject", "Message"  ;
Separating them with spaces...
HTH
------------------
Justin Nelson
FutureQuest Support<!-- NO_AUTO_LINK -->
[This message has been edited by Justin (edited 06-16-99)]
|
|
|
06-16-1999, 05:46 PM
|
Postid: 43199
|
|
CTO FutureQuest, Inc.
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,683
|
Hmmm, I really have no idea as BCC: and CC: and other stuff is a function of the mail client and not of the SMTP server... You might have to emulate the BCC: functionality yourself...
I learned a great deal turning on Full debugging with Eudora and viewing it's debug.log SMTP communications...
Perhaps someone will pull up the slack and research this... Any volunteers...
--
Terra
--Did too, did not, did too, did not--
FutureQuest
|
|
|
06-16-1999, 06:01 PM
|
Postid: 43200
|
|
Registered User
Join Date: Mar 1999
Location: Seattle, WA
Posts: 1,059
|
Not I! *L*
If I wasn't concerned about any of the others knowing that OTHER people were getting the mail, I'd just use another method...
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
|
|
|
09-29-1999, 09:01 PM
|
Postid: 43201
|
|
Registered User
Join Date: Mar 1999
Location: Seattle, WA
Posts: 1,059
|
Just for the record, pulled this off the PHP3 mailing list this afternoon, and it appears to work, somewhat...
mail("$mailto", "$title", "$body", "From: $mailfrom\nReply-To: $replyto\nX-Mailer: PHP\nErrors-To: $errorsto\nBCC: $bccto"  ;
[This message has been edited by Charles Capps (edited 09-29-99)]
|
|
|
09-30-1999, 01:13 AM
|
Postid: 43202
|
|
Visitor
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
|
Wow - only took you 3 months or so to finish that
Seriously though, I was pretty sure before that it didn't work that way (as a header), but I do think it does now... because when I send a message to, say, 300 people, all in the BCC line, if my statement above was correct I'd be sitting there for a while sending the mail. But last time I sent a mass mailing  30 addresses) using BCC, it was sent quite quickly, indicating it only went from PC to server one time, with the server handling the BCC part (contrary to what I had first thought).
The problem was I could not find ANY documentation on BCC in the RFC's... haven't looked in a while, but next time I'm out RFC hunting (yeah, I have a life) I'll try to find something official...
Glad you got it working though - but what do you mean by "somewhat"?
------------------
Justin Nelson
FutureQuest Support
|
|
|
09-30-1999, 01:21 AM
|
Postid: 43203
|
|
Registered User
Join Date: Mar 1999
Location: Seattle, WA
Posts: 1,059
|
There was some questioning on the mailing list about whether the \ns should be \n\r or \r\n or \n alone... \n alone worked fine for some, but not for others. Will post here if anything's decided. 
|
|
|
09-30-1999, 01:47 AM
|
Postid: 43204
|
|
Visitor
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
|
I have the solution for that - it's hard to explain, but it's the same exact reason the UBB's "sockets" option works under Win32 and not under Unix.
If the body of your message contains \r\n combo's, the headers should too - if not, they shouldn't.
The UBB uses a Perl here document:
print <<EOF;
This is the message.
Blah.
Yap.
EOF
Under Windows, each line is terminated with a \r\n (that you can't see of course). However, under Unix (after uploading in ASCII mode), it's simply \n.
It's probably best to print each line separately, and add your own line terminators:
print "This is my message\r\n";
print "This is line 2\r\n";
print "Bye now!\r\n";
Then, to be truly RFC compliant, use \r\n to separate headers.
However, I'm not sure if PHP internally separates it's headers with \r\n or just \n - keeping in mind it adds any headers you don't specify - and if you aren't consistant, it can/will break...
Argh, this stuff is heck, isn't it?  Fussing over line terminators - I'm surprised Unix and Windows don't use different characters for a space
What do I do to solve the problem? I simply do this in PHP:
mail (" blah@blah.com", "Hi, blah!", "Hi, blah! Write me back or something", "From: blah@noblah.yap"  ;
IOW, I only specify the From: header, since the Reply-To will be the same as the From by default if not specified - this avoids having to use line terminators at all  It works great until someone tells you to add an X-Mailer...
------------------
Justin Nelson
FutureQuest Support
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:12 AM.
|
| |
|
|
|