{"id":756,"date":"2008-01-04T19:58:12","date_gmt":"2008-01-05T02:58:12","guid":{"rendered":"http:\/\/members.crystalreportsbook.com\/crystal-reports-xi\/19-7-exporting-to-email\/"},"modified":"2010-11-17T18:48:42","modified_gmt":"2010-11-18T01:48:42","slug":"19-7-exporting-to-email","status":"publish","type":"post","link":"http:\/\/www.crystalreportsonlinetraining.com\/training\/19-7-exporting-to-email\/","title":{"rendered":"19.07 Exporting to Email"},"content":{"rendered":"<h2>Exporting to Email<\/h2>\n<p>Exporting a report to an email creates the report as a separate file and attaches it to an email message. This email message is automatically sent out to the recipient. Table 19-5 shows the properties for exporting to email. Each of these properties relates to the typical settings you find when sending an email message.<\/p>\n<p>         <b>Table 19-5. MicrosoftMailDestinationOptions Properties.<\/b><\/p>\n<table border=\"1\">\n<tr>\n<th>Property<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>MailCCList<\/td>\n<td>The list of emails to send a carbon copy to<\/td>\n<\/tr>\n<tr>\n<td>MailMessage<\/td>\n<td>The text portion of the email message<\/td>\n<\/tr>\n<tr>\n<td>MailSubject<\/td>\n<td>The text subject heading of the email message<\/td>\n<\/tr>\n<tr>\n<td>MailToList<\/td>\n<td>The email(s) of those receiving the report<\/td>\n<\/tr>\n<tr>\n<td>Password<\/td>\n<td>The password used when logging on to the email account<\/td>\n<\/tr>\n<tr>\n<td>UserName<\/td>\n<td>The user name used when logging on to the email account<\/td>\n<\/tr>\n<\/table>\n<p>         <code_Caption>Listing 19-3. Send a report as an attachment of an email.<\/code_Caption><br \/>\n         <code>Public Sub SetEmailDestination(ByVal MyReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal MailTo As String, ByVal CCList As String, ByVal Subject As String, ByVal Message As String, ByVal UserName As String, ByVal Password As String)<\/code><br \/>\n         <code>'Set the destination type to EMail<\/code><br \/>\n         <code>MyReport.ExportOptions.ExportDestinationType = _<\/code><br \/>\n         <code>CrystalDecisions.Shared.ExportDestinationType.MicrosoftMail<\/code><br \/>\n         <code>'Instantiate an Email options object and set its properties<\/code><br \/>\n         <code>Dim Options As CrystalDecisions.Shared.MicrosoftMailDestinationOptions = _<\/code><br \/>\n         <code>New CrystalDecisions.Shared.MicrosoftMailDestinationOptions<\/code><br \/>\n         <code>Options.UserName = UserName<\/code><br \/>\n         <code>Options.Password = Password<\/code><br \/>\n         <code>Options.MailSubject = Subject<\/code><br \/>\n         <code>Options.MailMessage = Message<\/code><br \/>\n         <code>Options.MailToList = MailTo<\/code><br \/>\n         <code>Options.MailCCList = CCList<\/code><br \/>\n         <code>'Assign the options object to the report<\/code><br \/>\n         <code>MyReport.ExportOptions.DestinationOptions = Options<\/code><br \/>\n         <code>End Sub<\/code><\/p>\n<p>This procedure first sets the report object&#8217;s destination type to be MicrosoftMail. Then it creates a new options variable and assigns the parameters to the appropriate properties. The last step assigns the options object to the DestinationOptions property of the report object.<\/p>\n<p>         <caution>Note: The attachment&#8217;s filename is created automatically and it is in the format of &#8220;Temp_&#8221; followed by a series of random numbers (similar to a GUID). You can&#8217;t specify the filename that the report gets exported to. Since email is a common method of sending viruses, this could cause the receiver to be initially alarmed or a spam filter might delete the email before it ever gets their Inbox. Make sure the recipient knows about this anomaly prior sending it to them.<\/caution><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exporting to Email Exporting a report to an email creates the report as a separate file and attaches it to an email message. This email message is automatically sent out to the recipient. Table 19-5 shows the properties for exporting to email. Each of these properties relates to the typical settings you find when sending [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,2],"tags":[],"class_list":["post-756","post","type-post","status-publish","format-standard","hentry","category-chapter-19-exporting-and-deploying-reports","category-crystal-reportsnet-2003","entry"],"_links":{"self":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/comments?post=756"}],"version-history":[{"count":1,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/756\/revisions"}],"predecessor-version":[{"id":1669,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/756\/revisions\/1669"}],"wp:attachment":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/media?parent=756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/categories?post=756"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/tags?post=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}