Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Auto export of excel file from Bizforms to email View modes: 
User avatar
Member
Member
vinci - 6/13/2011 4:10:53 AM
   
Auto export of excel file from Bizforms to email
Hi,

I would like to know is there any way to extract the bizform( e.g. contact us form) automatically within a said scheduled time and send to particular email address instead of sending the command by the "export excel file " button manually ?

Thanks in advance and appreciate all the help you all may provide.

User avatar
Member
Member
kentico_michal - 6/13/2011 6:27:03 AM
   
RE:Auto export of excel file from Bizforms to email
Hello,

Yes, this should be possible to accomplish. Please visit the following section of developer’s guide to find instructions on how you can shedule a custom code: Scheduling a custom code.

You will need to generate this excel file at first. You can find inspiration how to accomplish it in the following file: ~\CMSModules\BizForms\Tools\BizForm_Edit_Export.aspx.cs

To send the email you can use EmailSender.SendEmail(EmailMessage) method:

using CMS.EmailEngine;

EmailMessage msg = new EmailMessage();

msg.EmailFormat = EmailFormatEnum.Both;
msg.From = "test@kentico.com";
msg.Recipients = "support@kentico.com";
msg.Subject = "support";

EmailSender.SendEmail(msg);


The EmailMessage class provides also a property called Attachments that is standard AttachmentCollection.


Best regards,
Michal Legen