The task is to send per email the csv file with trend.
As example the script ExportTrendData was taken. The file name must be a combination of data in a TextBox on the screen (ship's name) and the current date.
public string ExportTableToCSV(string tableName)
{
string trendDataCSVFileName=Path.Combine("HardDisk",Globals.Tags.ShipsName.Value.ToString()+" "+DateTime.Today.ToString("D")+".csv");
//a new tag TrendAttachmentFileName was created and valued
Globals.Tags.TrendAttachmentFileName.Value=trendDataCSVFileName
}
Actually, it works. A trend data file with a proper name is being written to a USB stick attached to the panel. But how can I send the file per email?
I tried another script, the MailScriptModule. It send emails, but without the file.
sending trend per email
Re: sending trend per email
Take a look at the example script "MailScriptModule" again... I think what you want to do is add your file as an attachment. If you look, the "MailScriptModule" actually creates a file and then attaches is to the email. You would just need to modify it to send your file instead. Either that, or make the message body part of the email contain your information.
Best Regards,
Beijer Electronics, Inc.
Skylar Walker | Applications Engineer
Beijer Electronics, Inc.
Skylar Walker | Applications Engineer
Re: sending trend per email
It works now. I only had to remove part of the code which deleted the file I wanted to be sent and created a dummy attachment instead. Thank You.
Re: sending trend per email
Best regards,
Christopher
(801) 708-6690
Technical Support
Contact Us
Beijer Electronics AB
http://www.beijerelectronics.us
Christopher
(801) 708-6690
Technical Support
Contact Us
Beijer Electronics AB
http://www.beijerelectronics.us