Sending E-Mail

Sending e-Mail can also be controlled via the list of export options (see section Export Without User Interaction) if export and sending should be done in one step. An example showing that is the "Export Sample".

However, independent of the previous export, it is also possible to send any files via e-Mail by using the MailJob class. This is especially interesting when generating a PDF file from the preview file as a source (see section Join and Convert Preview Files) and the PDF file is supposed to be sent via e-mail.

// Instantiate mail job

MailJob mailJob = new MailJob();

 

// Set options

mailJob.AttachmentList.Add(@"<Path>\report.pdf");

mailJob.To = "info@combit.net";

mailJob.Subject = "Here is the report";

mailJob.Body = "Please note the attachment.";

mailJob.Provider = "XMAPI";

mailJob.ShowDialog = true;

 

// Send e-Mail

mailJob.Send();

mailJob.Dispose();