Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Mail tool to add CC and BCC

by atcroft (Monsignor)
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 mail.example.com 25 Trying 127.0.0.42... Connected to mail.example.com (127.0.0.42). Escape character is '^]'. 220 mail.example.com ESMTP HELO mail.example.org 250 mail.example.com MAIL FROM: <sender@example.org> 250 ok RCPT TO: <recipient1@example.com> 250 ok RCPT TO: <recipient2@example.com> 250 ok RCPT TO: <recipient3@example.com> 250 ok DATA 354 go ahead Date: 02 Sep 2011 01:45:59 -0500 Subject: test From: "Sender" <sender@example.org> To: "Recipient 1" <recipient1@example.com> CC: "Recipient 2" <recipient2@example.com> test . 250 ok 1314945967 qp 19908 quit 221 mail.example.com 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 mail.example.org (HELO mail.example.org) (127.0.0.23) by mail.example.com with SMTP; 2 Sep 2011 01:46:20 -0500 Received-SPF: pass (mail.example.org: SPF record at example.org designates 127.0.0.23 as permitted sender) Date: 02 Sep 2011 01:45:59 -0500 Subject: test From: "Sender" <sender@example.org> To: "Recipient 1" <recipient1@example.com> CC: "Recipient 2" <recipient2@example.com> test

Hope this helps.

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


Comment on Re: Mail tool to add CC and BCC
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://923773]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-12-28 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls