Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Mail tool to add CC and BCC

by atcroft (Abbot)
on Sep 02, 2011 at 06:52 UTC ( #923773=note: print w/replies, xml ) Need Help??

in reply to Mail tool to add CC and BCC

You do know the difference between headers and envelope headers, right?

Since you didn't provide an example of the code you are looking at, let's take a different approach to showing what happens... If I want to send an email by connecting to a mail server (for instance, through a telnet program), it would look something like this:

$ telnet 25 Trying Connected to ( Escape character is '^]'. 220 ESMTP HELO 250 MAIL FROM: <> 250 ok RCPT TO: <> 250 ok RCPT TO: <> 250 ok RCPT TO: <> 250 ok DATA 354 go ahead Date: 02 Sep 2011 01:45:59 -0500 Subject: test From: "Sender" <> To: "Recipient 1" <> CC: "Recipient 2" <> test . 250 ok 1314945967 qp 19908 quit 221 Connection closed by foreign host.

What this means is that BCC recipients are those who appear in the envelope header (RCPT TO lines), whereas TO and CC recipients appear both there and in the DATA section of the email.

This gives you the following email:

Received: (qmail 12019 invoked from network); 2 Sep 2011 01:46:09 -0500 Received: from (HELO ( by with SMTP; 2 Sep 2011 01:46:20 -0500 Received-SPF: pass ( SPF record at designates as permitted sender) Date: 02 Sep 2011 01:45:59 -0500 Subject: test From: "Sender" <> To: "Recipient 1" <> CC: "Recipient 2" <> test

Hope this helps.

Update: 2011-09-02
Added sample email output.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://923773]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2018-02-20 13:58 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.