sending trend per email
Posted: Fri Mar 02, 2012 4:42 am
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.
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.