Emailing Crystal Reports using MicrosoftMail

  • Thread starter Thread starter zEE
  • Start date Start date
Z

zEE

Hi,

I'm facing an issue when I use the MicrosoftMail option for emailing
the crystal report. My code is as follows -

ReportDocument ReportFile = new ReportDocument();
ReportFile.Load(filename);
ReportFile.SetDataSource(DataSet1);
CrystalDecisions.Shared.ExportOptions myExportOptions;

CrystalDecisions.Shared.MicrosoftMailDestinationOptions mymail=new
MicrosoftMailDestinationOptions();

myExportOptions = ReportFile.ExportOptions;

myExportOptions.DestinationOptions=mymail;
myExportOptions.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.MicrosoftMail;

myExportOptions.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;

ReportFile.Export(); //// When i run this it says "invalid export
options"

// ReportFile.ExportToHttpResponse(myExportOptions,response,false,"");

// When i run the above line it says "thread aborted"

Plz help me ... How to send an email .
 
First of all, you have to have Microsoft Mail installed on the web server to
get this to work.

Instead, why not convert this to a PDF and use the Mail namespace
functionality in .NET to send the PDF as an attachment?
 
Back
Top