Sendmail To Multiple Users Without CC

To put multiple addresses on the To: or Cc: or Bcc: line, separate them by a comma (plus optional spaces). There are mail readers that allow typing a semicolon to separate addresses and show addresses separated by semicolons, but this is not standard syntax.

From: sendmail
To: [email protected], [email protected]
Subject: Did You Both Receive It?

You can split the header onto multiple lines after the comma (and at some other places in the address, but this is trickier). The continuation line must start with at least one space or tab.

From: sendmail
To: [email protected],
    [email protected]
Subject: Did You Both Receive It?

You can use the To: header several times. I was a little skeptical about it, but I just tried it on a SMTP server, and it accepted it.

So, instead of sending...

From: sendmail
To: [email protected]
Cc: [email protected]
Subject: Did You Both Receive It?

I hope you did

... you could send:

From: sendmail
To: [email protected]
To: [email protected]
Subject: Did You Both Receive It?

I hope you did

In my client (Thunderbird), the recipients appear together, as:

To person01 <[email protected]>, person02 <[email protected]>

and the source remains intact (the To:s were not transformed on the way) :

To: [email protected]
To: [email protected]

Now, since the SMTP server allowed me to send two RCPT TO: messages, I'm assuming sendmail would be able to do this as well. Probably something like...

$ sendmail "[email protected],[email protected]" <<EOF
To: [email protected]
To: [email protected]
...

Your message.
EOF

Tags:

Email

Sendmail