Sending the report by email

Top  Previous 

FastReport allows you to send a prepared report by email. It may work in two modes:





This is default mode. To send an email, you don't need any external programs.


You may turn on this mode programmatically. To do this, set Config.EmailSettings.UseMAPI = true, or, if  you use EnvironmentSettings component, set its EnvironmentSettings.EmailSettings.UseMAPI property to true.


To send an email, FastReport uses the default email client such as Outlook Express. This client must support the MAPI protocol.


To send an email, you need to specify a recipient's email address. Also you need to specify the subject and email body, but this is not required. At the bottom of the dialog, select the format of your report - it will be attached to the message:




If you use the SMTP mode, you need to set up an account. It is necessary to do only once. Once you have done it, FastReport will save the parameters in the configuration file. The parameters can be found on the "Account" tab. All obligatory fields are marked by red asterisk:




If your host server requires an authentication, you need to fill in "User name" and "Password" fields as well.