0

I am trying to send emails from hyperion servers when the number of records is 0.I am writing the script code in onPostProcess().

var dtm_current = new Date();
Application.ExecuteBScript("Set BrioQuery, Mail, 'Internet Mail', mailserverwithoutquotes,fromid'"); //note that mailserver name is given without quotes and 
//from id does nt have starting quote
Application.ExecuteBScript("Export Section Root.'Results', OfficeMHTML, 'job_output', Silent, email, 'Testing Email action', 'This is a test of the email action. \n\n\n', UTF-8, To, tomailid'");
Console.Writeln ( "Post Process Script complete:"+dtm_current );

I am getting the error Emailing section 'Results' as 'Microsoft Office Web Archive' to: com'

Export failed. Error: Connection failed to locate host, 127.0.0.1. Is the SMTP server on port 25? (Errcode=146)

Question I have : Why it is trying to connect to localhost instead of specified email server

ZnArK
  • 1,533
  • 1
  • 12
  • 23

1 Answers1

0

I have got this working.

var dtm_current = new Date(); Application.ExecuteBScript("Set BrioQuery, Mail, 'Internet Mail', emailserverwithoutquotes,'fromemailid'"); var count =1* ActiveDocument.Sections['R-Results'].RowCount;

Console.Writeln(count); if(count > 0){ Application.ExecuteBScript("Export Section Root.'R-Results', csv, 'job_output', Silent, email, 'Testing Email action if', 'This is a test of the email action if. \n\n\n', UTF-8, To, 'tomailid'"); } else{ Application.ExecuteBScript("Export Section Root.'R-Results', csv, 'job_output', Silent, email, 'Testing Email action else', 'This is a test of the email action else. \n\n\n', UTF-8, To, 'tomailid'"); }