Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: sending trend per email
PostPosted: Fri Mar 02, 2012 4:42 am 

Joined: Fri Jan 27, 2012 4:20 am
Posts: 173

Offline
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.


 Profile  
 
 Post subject: Re: sending trend per email
PostPosted: Fri Mar 02, 2012 10:21 am 

Joined: Wed Jan 04, 2012 11:17 am
Posts: 42

Offline
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


 Profile  
 
 Post subject: Re: sending trend per email
PostPosted: Thu Mar 08, 2012 6:27 am 

Joined: Fri Jan 27, 2012 4:20 am
Posts: 173

Offline
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.


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron