We’ve all seen the CC and BCC fields when we send email, but do you know what they’re for?
Sending an email does not happen on a peer-to-peer basis, meaning that sending an email doesn’t just transmit it directly to the recipient’s computer. Emails must pass through at least one server to get to their destination, though the message will usually pass through several servers. The act of sending an email happens via a process directed by Simple Mail Transfer Protocol (SMTP).
What is BCC and CC?
BCC and CC are both ways of sending email copies to different people.
CC simply stands for the familiar term “carbon copy.” In the context of email, a CCed email is a copy sent to an individual other than the main recipient.
BCC stands for “blind carbon copy,” which can be used to send an email to a recipient without the other recipients being able to see. You can imagine the benefit of this option, as there are many occasions where multiple people need the same email, but shouldn’t have access to the email addresses of the other recipients.
In order to answer the question concerning the code that makes BCC or CC operate in an email, we’ll need to understand a little more about how email works.
What is SMTP?
SMTP is an internet protocol designed specifically for sending email over the internet.
An internet protocol is a set of standards used for communicating on the internet. Any internet protocol will have defined commands to be used for exchanging data. For example, a well-known protocol is Hypertext Transfer Protocol (HTTP), which is used for requesting web page files from a server.
Using SMTP, an email user sends data to a server that is retrieved by an email recipient.
Does it matter?
Each SMTP request tells a server where to send a message based on what the email user inputs into their email client. As a result, SMTP plays an important role in determining who a message gets sent to in the BCC and CC format.
Here are the steps to send an email:
- A client initiates a communication with a server by sending a HELO or EHLO command to the SMTP server (e.g. smtp.gmail.com, smtp.yahoo.com, etc.). If the server is available, it returns a 250 OK status code.
- The client sends a MAIL FROM command with the email of the sender enclosed in angle brackets, like so: MAIL FROM:<email@example.com>. The server again returns a status code.
- The client then gives the command RCPT TO with the email for as many recipients as the client provided, like so: RCPT TO:<firstname.lastname@example.org>. This command is repeated for as many CC and BCC recipients as the client listed.
- The client then passes all the data of the email with the DATA command, which also includes the email addresses of the sender, TO recipients, and CC recipients. The email is now available on each recipient’s server to be retrieved the next time he or she logs in.
Although the steps between BCC and CC are similar, it’s really depends on what type of email you’re sending out and who you want to see it.
As you walked though these steps, you may have picked up on how the mail server keeps BCC recipients private and all other recipients public. As the mail servers send a new copy of each email to each recipient, only To and CC recipients are passed in the DATA command to be handled by the email service. Each BCC email address is only used in the RCPT TO command and is, therefore, never divulged.
While most people will never need to dig into the complex underbelly of sending email, you can check out documentation for how to host email code on your own server.