Using To, Cc, and Bcc Lists Together
Previous Topic  Next Topic 

Purpose

 

This example demonstrates how NetMailBot addresses emails when using To, Cc, and Bcc addressees together. Here we use list files and the -tolist-cclist, and -bcclist parameters. We discuss the results when -recipientlimit is set to 1 and otherwise.

 

The -tolist-cclist, and -bcclist parameters are used only with flat text files that contain email addresses and no other information (i.e. they are not a text file version of "database" connectivity).

 

Prepared Example Files

 

 

The archive contains four files:

 

 

File Contents

 

This is the content of the batch file:

 

NetMailBot -to test@test.com -tolist "tolist.txt" -cclist "cclist.txt" -bcclist "bcclist.txt" -from test@test.com -server smtp.test.com -recipientlimit 1

 

This is the content of the tolist.txt file:

 

to1@test.com,to2@test.com,to3@test.com

 

This is the content of the cclist.txt file:

 

cc1@test.com,cc2@test.com,cc3@test.com

 

This is the content of the bcclist.txt file:

 

bcc1@test.com,bcc2@test.com,bcc3@test.com

 

Steps

 

  1. Unzip the CombinedAddresseeTypes.zip file. This will produce a directory called "CombinedAddresseeTypes". Open this directory.
  2. Open Notepad and edit the batch file "CombinedAddresseeTypes.bat". Change the values of the parameters -to-from, and -server to your email address and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. With -recipientlimit set to 1 as in the batch file above, NetMailbot should start up and produce output similar to the following:

 

Connecting to smtp.test.com

Preparing message

Adding TO(1): to1@test.com

Adding CC(2): cc1@test.com

Adding BCC(3): bcc1@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(4): to2@test.com

Adding CC(5): cc2@test.com

Adding BCC(6): bcc2@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(7): to3@test.com

Adding CC(8): cc3@test.com

Adding BCC(9): bcc3@test.com

Sending message

Sent to mail server

Disconnecting

 

Mail sent successfully to 9 recipients

 

In this case, there were three email messages sent, each with one "To:" recipient, one "Cc:" recipient, and one "Bcc:" recipient.

 

If, however, you change the batch file so that -recipientlimit is not set to 1 (or omit it entirely, in which case it defaults to 100) the results will now appear as:

 

Connecting to smtp.test.com

Preparing message

Adding TO(1): to1@test.com

Adding TO(2): to2@test.com

Adding TO(3): to3@test.com

Adding CC(4): cc1@test.com

Adding CC(5): cc2@test.com

Adding CC(6): cc3@test.com

Adding BCC(7): bcc1@test.com

Adding BCC(8): bcc2@test.com

Adding BCC(9): bcc3@test.com

Sending message

Sent to mail server

Disconnecting

 

Mail sent successfully to 9 recipients

 

So this time we only sent one email message with three recipients each for the "To:", "Cc:", and "Bcc:" header addressing fields.

 

Note that -recipientlimit 1 used in the first example applies to each type of addressee ("To:", "Cc:", and "Bcc:") independently: there is only one recipient of each type per email. In the second example all three of each type of addressee are added to the one email sent. We didn't get anywhere near the default limit of 100 recipients. If we had exceeded this default limit, then another email message would have been sent to the "remainder" recipients.