Changing the Delimiter in Log and List Files
Previous Topic  Next Topic 

Purpose

 

This example demonstrates how to use NetMailBot's -delimiter parameter to alter the character(s) used to delimit email addresses logged in good, bad, and suspect email logs (recall that these are generated with the -loggoodemail-logbademail, and -logsuspectemail parameters, respectively). This can be useful if you need to use a different delimiter than the default, which is a space.

 

NOTE: Carriage Return / Line Feed (CR/LF) cannot be used as the delimiter.

 

NOTE: -delimiter also determines what delimiting character(s) to expect in email list files specified in the -tolist-cclist, and -bcclist parameters. Therefore, using -delimiter makes it a requirement that the same delimiter be used both in generated good / bad / suspect log files and multiple-recipient list files (for -tolist-cclist, and -bcclist).

 

Prepared Example Files

 

 

The archive contains two files:

 

 

Batch File Contents

 

This is the content of the batch file:

 

NetMailBot -to test@exclamationsoft.com -body "Using a Customized Delimiter" -cclist "cclist.txt" -from test@exclamationsoft.com -server smtp.mycompany.com -subject "Customized Delimiter" -delimeter ":" -loggoodemail "goodmails.txt" -logbademail "bademails.txt" -recipientlimit 2

 

This is the content of the cclist.txt file:

 

001@test.com:002@test.com:003@test.com:004@test.com

 

Steps

 

  1. Unzip the CustomDelimiter.zip file. This will produce a directory called "CustomDelimiter". Open this directory.
  2. Open Notepad and edit the batch file "CustomDelimiter.bat". Change the values of the parameters -to, -from, and -server to two email addresses of your choosing and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and you should see output similar to the following. In a more realistic setting you might have hundreds of "CC:" recipients and thus might omit the use of -recipientlimit. In that case each mail sent would be addressed to the "To:" recipient plus 100 "Cc:" recipients (the default recipient limit).

 

NOTE: Thus, when sending to "Cc:" or "Bcc:" recipients, the "To:" address is ignored in the count specified by -recipientlimit. This is reflected in the output below: each mail has two "Cc:" recipients, and -recipientlimit was set to 2.

 

Connecting to smtp.comcast.net

Preparing message

Adding TO(1): test@exclamationsoft.com

Adding CC(2): 001@test.com

Adding CC(3): 002@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(4): test@exclamationsoft.com

Adding CC(5): 003@test.com

Adding CC(6): 004@test.com

Sending message

Sent to mail server

Disconnecting

 

Mail sent successfully to 6 recipients

 

Here is the "goodemails.txt" log file resulting from the above operation (using our custom delimiter):

 

test@exclamationsoft.com:001@test.com:002@test.com:test@exclamationsoft.com:003@test.com:004@test.com:

 

NOTE: You may be wondering about our test "Cc:" email addresses in this example: they seem to be "bogus" addresses, so why did they show up in the "goodemails.txt" file? Did we receive any bounces? The answer is no.

 

By definition, a "bounced" email is one that has been returned, after a period of time, because the sending SMTP server cannot contact the domain of the email address being sent to.

 

During the send, our SMTP server is not verifying the validity of the email addresses used. Therefore, none of them go into the "bad" category. The bad and suspect log files are mainly used for the verification functionality of NetMailBot and are hardly ever populated when just sending email. We have included -logbademail here just to illustrate this dynamic.

 

We say "mainly" and "hardly" because only about 1% of SMTP servers will lookup an email address without being explicitly asked to verify it, and an address might show up in the "bad" category if it is malformed, like "akjdlfjslf" (no domain specified) or if it is in the same domain as the mail server, but the mail server does not recognize it as being valid. This behavior varies from server to server. For instance, suppose we are using the server smtp.mycompany.com to send email with NetMailBot. An address like akjfljslkfjlasj@mycompany.com could be rejected by this server because it is not a valid email address on the mycompany.com domain.

 

NOTE: Email address verification is maintained in NetMailBot only for backward compatibility with older versions, but is no longer a supported feature.