FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > PHP, Perl, Python and/or MySQL
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-16-1999, 03:35 PM   Postid: 43195
Charles Capps
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
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/
Charles Capps is offline   Reply With Quote
Old 06-16-1999, 05:03 PM   Postid: 43196
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,674
Off the top of my head, try using commas ',' instead of '\n' to separate the addies...

--
Terra
--What? me liable!--
FutureQuest
Terra is offline   Reply With Quote
Old 06-16-1999, 05:21 PM   Postid: 43197
Charles Capps
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
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/
Charles Capps is offline   Reply With Quote
Old 06-16-1999, 05:44 PM   Postid: 43198
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
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)]
Justin is offline   Reply With Quote
Old 06-16-1999, 05:46 PM   Postid: 43199
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,674
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
Terra is offline   Reply With Quote
Old 06-16-1999, 06:01 PM   Postid: 43200
Charles Capps
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
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/
Charles Capps is offline   Reply With Quote
Old 09-29-1999, 09:01 PM   Postid: 43201
Charles Capps
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
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(&quot;$mailto&quot;, &quot;$title&quot;, &quot;$body&quot;, &quot;From: $mailfrom\nReply-To: $replyto\nX-Mailer: PHP\nErrors-To: $errorsto\nBCC: $bccto&quot;
[This message has been edited by Charles Capps (edited 09-29-99)]
Charles Capps is offline   Reply With Quote
Old 09-30-1999, 01:13 AM   Postid: 43202
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
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 &quot;somewhat&quot;?

------------------
Justin Nelson
FutureQuest Support
Justin is offline   Reply With Quote
Old 09-30-1999, 01:21 AM   Postid: 43203
Charles Capps
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
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.  
Charles Capps is offline   Reply With Quote
Old 09-30-1999, 01:47 AM   Postid: 43204
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
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 &quot;sockets&quot; 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 &quot;This is my message\r\n&quot;;
print &quot;This is line 2\r\n&quot;;
print &quot;Bye now!\r\n&quot;;

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 (&quot;blah@blah.com&quot;, &quot;Hi, blah!&quot;, &quot;Hi, blah! Write me back or something&quot;, &quot;From: blah@noblah.yap&quot;

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
Justin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:49 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.