SendMailJobCollectionGetIndicesAsString Method
Returns the string containing comma-separated list of data table row indices associated with the jobs belonging to the collection.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public string GetIndicesAsString(
	DataTable mergeTable,
	string tag
)

Parameters

mergeTable
Type: System.DataDataTable
A reference to the data table for which data row indices should be returned, or a null reference (Nothing in Visual Basic) if data rows should be returned regardless with which mail merge tables they are associated.
tag
Type: SystemString
The string equal to Tag of jobs for which data row indices should be returned, or a null reference (Nothing in Visual Basic) if data rows should be returned regardless of their Tag value. String comparison is case-sensitive, i.e. Merge1 and MERGE1 won't match!

Return Value

Type: String
The string containing comma-separated list of data table row indices associated with the jobs belonging to the collection and associated with the given data table, or an empty string if the collection is empty.
Remarks

This method can be typically used to get the results of mail merge (which rows have been processed successfully, which have been failed, etc). Later, Smtp.AddJobs method can be used to populate Smtp.JobsPending collection with the stored values.

If, for some reason, the developer needs to work with indices of particular jobs, this can be done using SendMailJob.GetIndicesAsString method. The current method internally uses SendMailJob.GetIndicesAsString to get indices for jobs that match the given criteria. See SendMailJob.GetIndicesAsString method documentation for more information on how MailBee returns indices of a single job's data rows.

Note Note

To place failed jobs back into Smtp.JobsPending collection, it's easier to use Smtp.RetryFailedJobs method. However, Smtp.RetryFailedJobs method cannot be used in the case if the application shuts down after performing mail merge cycle and thus all the information in the Smtp.JobsXXX collections gets lost.

In this case, the developer may want to get the list of failed data rows and then save it into persistent storage such as a file or a database. Later, the application starts again, loads this file and gets the list of data rows to process, and processes them. This scenario can be implemented with GetIndicesAsString(DataTable, String) and Smtp.AddJobs methods.

Examples
See Also