Can somebody please direct me some sample code or a off the shelf control
to help me understand what I need to do to email a Crystal Report? I want
to email from the report itself if possible.
this code works but two things: (a) it generates the Outlook security
waraning when it runs, and (b) the attachment sent in the email is title
"untitled.txt" ... if you rename the attachment to PDF extension, it opens
as a PDF; I just haven't figure out yet how to spcify the name of the
attachment ... or get around the Outlook security warning .. maybe you can
solve those issues and report back.
PdfRtfWordFormatOptions pdfOpts =
ExportOptions.CreatePdfRtfWordFormatOptions();
MicrosoftMailDestinationOptions mailOptions =
ExportOptions.CreateMicrosoftMailDestinationOptions();
ExportOptions exportOpts = new ExportOptions();
pdfOpts.UsePageRange = false;
exportOpts.ExportFormatOptions = pdfOpts;
mailOptions.MailMessage = "My Report is enclosed";
mailOptions.MailSubject = "Crystal Mail";
mailOptions.MailToList = "(e-mail address removed)"
mailOptions.UserName = "userName";
mailOptions.Password = "password";
exportOpts.ExportDestinationOptions = mailOptions;
exportOpts.ExportDestinationType = ExportDestinationType.MicrosoftMail;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
register.Export(exportOpts);