Hi Oran,
1) regrettably, we do not support searching in media library in current version of Kentico CMS. However, we plan to add this feature to one of next versions.
Nowadays, you would need to develop the search functionality for media library by yourself. Data of Media library files are in Media_File table in database.
2) You may use API to send e-mails with attachment. Sample code is:
//new EmailMessage
EmailMessage msg = new EmailMessage();
//set From
msg.From = "userfrom@domain.com"; // use valid e-mail
//set Recipients
msg.Recipients = "userto@domain.cz"; // use valid e-mail
//set Subject
msg.Subject = "attachment test";
//set Body
msg.Body = "body email text";
//new AttachmentManager
AttachmentManager am = new AttachmentManager();
//new attachmentGuid
Guid attachmentGUID = new Guid("0de95d34-67a7-4285-ae65-5ca5bfc7f0b7");
//set attachmentName
String attachmentName = "pdfTest.pdf";
//new MemoryStream
MemoryStream ms = new MemoryStream(am.GetFile(attachmentGUID, CMS.CMSHelper.CMSContext.CurrentSiteName.ToString()));
//new Attachment
Attachment mailAttachment = new Attachment(ms, attachmentName, "application/pdf");
//add attachment to message
msg.Attachments.Add(mailAttachment);
CMS.EmailEngine.EmailSender.SendEmail(msg); // uses global smtp settings
//CMS.EmailEngine.EmailSender.SendEmail(CMS.CMSHelper.CMSContext.CurrentSiteName, msg); //uses local smtp settings
API Reference is here:
http://devnet.kentico.com/downloads/kenticocms_api.zipBest regards,
Helena Grulichova