asaikk Posted February 25, 2012 Share Posted February 25, 2012 Hi, For an exercise, I made a sequence below; 1)function : SendEmailFile() 2)a sequence to trigger "SendEmailFile()" : TestFunctionSendEmailFile \\ function SendEmailFile function SendEmailFile(string FilePathSent) email.strTo = "my@myhome.com" email.strCC = "theboss@hishome.com" email.strSubject = "File delivery/from DAQ" email.strBody = "Please find the attached file" email.strFile = FilePathSent email.Send() \\ TestFunctionSendEmailFile private string FilePathSent = "C:\aa onlinesoft\datalogger\log2.xlsx" SendEmailFile(FilePathSent) But it did not work, with a message indicating an error on the second line of "TestFunctionSendEmailFile" Is the script "SendEmailFile(FilePathSent)" not right? Before making the sequence above, I had tried the sequence below which worked fine, leading me to proceed above. \\ SendEmailWithFile email.strTo = "my@myhome.com" email.strCC = "theboss@hishome.com" email.strSubject = "Test email with a file/from DAQ" email.strBody = "Test email with a file" email.strFile = "C:\aa onlinesoft\datalogger\log2.xlsx" email.send() Thanks in advance. Link to comment Share on other sites More sharing options...
AzeoTech Posted February 27, 2012 Share Posted February 27, 2012 Line 2 of your sequence is the function declaration line. I don't see anything wrong with it, and in fact, I created a sequence called SendEmailFile and posted your script and it worked just fine, so likely there is a typo somewhere that is not coming through by your posting. In general this is why I recommend posting your .ctl, as then I can see if the problem is coming from elsewhere. Link to comment Share on other sites More sharing options...
asaikk Posted February 27, 2012 Author Share Posted February 27, 2012 Thank you for checking my script. I post my .ctl with the sequence in question on it, following your advice. I would appreciate if you would check it. test_FunctionSendEmailFileR2.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted February 27, 2012 Share Posted February 27, 2012 The first line of your script has two backslashes. For a comment you want two forward slashes //. You can tell you have a comment because it will display in red. Link to comment Share on other sites More sharing options...
asaikk Posted February 29, 2012 Author Share Posted February 29, 2012 The sequence below "SendEmailFile" now began to work fine after correcting the name of the sequence. (I found that the name should be nothing but "SendEmailFile"!) // function SendEmailFile function SendEmailFile(string FilePathSent) email.strTo = "09092414228@i.softbank.jp" email.strCC = "asaikk@suisui.ne.jp" email.strSubject = "File delivery/from DAQ" email.strBody = "Please find the attached file" email.strFile = FilePathSent email.Send() But then the sequence below to trigger the "SendEmailFile" has a problem, having an error message; "C1008 Could not send message! Response: 354 Ok Send data ending with <CRLF>.<CRLF>" // Check2 Trigger function SendEmailFile while(1) SendEmailFile("C:\aa onlinesoft\datalogger\log\MyLog_120229_2034.csv") delay(60) endwhile Could you give me the explanation of the the message? I post the ctl file. Thank you in advance. test_FunctionSendEmailLogFile.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted February 29, 2012 Share Posted February 29, 2012 Any email error messages that have "Response:" in it, mean that DF communicated with the server, but the server sent back an error. In this case, the error code is 354, and the message from the server is "Ok Send data ending with <CRLF>.<CRLF>" From here you have to search the internet to figure out why your server doesn't like the incoming email. A very quick glance tells me that your server may be checking the reply to address and rejecting the email because it doesn't exist, or doesn't match the account. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.