Sys Email
Sys Email
602,"Sys.Email"
562,"NULL"
586,
585,
564,
565,"y39o[?:;[S1vCrVWfnvR4=\\`aDGMN5oU^d9cMc\
Xir;`j9_Mm80hbw7ApwK4v034t_QEKT8nWm2jLkr\2AlU]lk;k4=Gj=3=nmVqI=?
R;`zWj_;=e]VHYNdeXlB<SwY=9XRf3vWdCb\V20G`:eidR@^LpbRNc01AlI?
rDWFtkLvFgNX4ieppYJ`1NtrBnQ7L`uc5X_T"
559,1
928,0
593,
594,
595,
597,
598,
596,
800,
801,
566,0
567,","
588,"."
589,
568,""""
570,
571,
569,0
592,0
599,1000
560,5
pRecipients
pSubject
pBody
pAttachment
pDebug
561,5
2
2
2
2
1
590,5
pRecipients,"bwan@cubewise.com"
pSubject,"Daily Sales"
pBody,"Please open attachment for details"
pAttachment,"c:\TM1\Report\DailySales.xlsx"
pDebug,0
637,5
pRecipients,"List of E-mail Recipients (Comma Seperated)"
pSubject,"E-mail Subject Line"
pBody,"E-mail Body"
pAttachment,"List of Attachments (Optional, Comma Seperated)"
pDebug,"Debug Mode: (0 = False, 1 = True)"
577,0
578,0
579,0
580,0
581,0
582,0
603,0
572,47
###################################################################################
####
#
# READ ME
# This is a script that uses Windows Powershell sending e-mail
# In order to use the script properly, please make sure the Powershell version is
at least version 3
# For Windows 2008 R2:
# http://social.technet.microsoft.com/wiki/contents/articles/20623.step-by-step-
upgrading-the-powershell-version-4-on-2008-r2.aspx
# Installing_the_DOTnet_amp_after_that_reboot_is_required
# Written by: Cubewise
# Date: 13 Nov 2019
#
###################################################################################
####
cMailDelim01 = ',';
cMailDelim02 = ';';
cRecipients = pRecipients;
cMailSubject = pSubject;
cMailBody = pBody;
cMailAttachments = pAttachment;
cSMTPServer = 'smtp.office365.com';
cSMTPPort = '587';
cMailSender = 'edu@cubewise.com';
cMailCredentialUserName = 'edu@cubewise.com';
cMailCredentialPassword = 'MyPassword';
cMailSSL = 'Y';
nError = 0;
###################################################################################
####
#
# VALIDATION
#
###################################################################################
####
573,3
######################
### Quit Process When Validation Failed
######################
If (nError <> 0);
ProcessQuit();
Endif;
######################
### Update Recipients so that it supports the format that Powershell supports
######################
sMailRecipients = '';
sRecipients = cRecipients;
nDelimIndex = 1;
While (nDelimIndex <> 0 & Long(sRecipients) > 0);
nDelimIndex01 = Scan(cMailDelim01, sRecipients);
nDelimIndex02 = Scan(cMailDelim02, sRecipients);
If (nDelimIndex01 <> 0 & nDelimIndex02 <> 0);
If (nDelimIndex01 < nDelimIndex02);
nDelimIndex = nDelimIndex01;
Else;
nDelimIndex = nDelimIndex02;
Endif;
ElseIf (nDelimIndex01 <> 0 & nDelimIndex02 = 0);
nDelimIndex = nDelimIndex01;
ElseIf (nDelimIndex01 = 0 & nDelimIndex02 <> 0);
nDelimIndex = nDelimIndex02;
ElseIf (nDelimIndex01 = 0 & nDelimIndex02 = 0);
nDelimIndex = 0;
Endif;
sRecipient = '';
If (nDelimIndex <> 0);
sRecipient = Trim(SubSt(sRecipients, 1, nDelimIndex - 1));
sRecipients = Trim(Subst(sRecipients, nDelimIndex + 1, Long(sRecipients) -
Long(sRecipient)));
Else;
sRecipient = Trim(sRecipients);
Endif;
If (sRecipient @<> '');
sMailRecipient = Char(39) | Trim(sRecipient) | Char(39);
If (sMailRecipients @<> '');
sMailRecipients = sMailRecipients | ',';
Endif;
sMailRecipients = sMailRecipients | sMailRecipient;
Endif;
End;
######################
### Update Attachments so that it supports the format that Powershell supports
######################
sMailAttachments = '';
sAttachments = cMailAttachments;
nDelimIndex = 1;
While (nDelimIndex <> 0 & Long(sAttachments) > 0);
nDelimIndex01 = Scan(cMailDelim01, sAttachments);
nDelimIndex02 = Scan(cMailDelim02, sAttachments);
If (nDelimIndex01 <> 0 & nDelimIndex02 <> 0);
If (nDelimIndex01 < nDelimIndex02);
nDelimIndex = nDelimIndex01;
Else;
nDelimIndex = nDelimIndex02;
Endif;
ElseIf (nDelimIndex01 <> 0 & nDelimIndex02 = 0);
nDelimIndex = nDelimIndex01;
ElseIf (nDelimIndex01 = 0 & nDelimIndex02 <> 0);
nDelimIndex = nDelimIndex02;
ElseIf (nDelimIndex01 = 0 & nDelimIndex02 = 0);
nDelimIndex = 0;
Endif;
sAttachment = '';
If (nDelimIndex <> 0);
sAttachment = Trim(SubSt(sAttachments, 1, nDelimIndex - 1));
sAttachments = Trim(Subst(sAttachments, nDelimIndex + 1,
Long(sAttachments) - Long(sAttachment)));
Else;
sAttachment = Trim(sAttachments);
Endif;
If (sAttachment @<> '');
sMailAttachment = Char(39) | Trim(sAttachment) | Char(39);
If (sMailAttachments @<> '');
sMailAttachments = sMailAttachments | ',';
Endif;
sMailAttachments = sMailAttachments | sMailAttachment;
Endif;
End;
######################
### Create Command and Execute
######################
sCommandPS = '$securepass = ConvertTo-SecureString -AsPlainText -String ' |
Char(39) | cMailCredentialPassword | Char(39) | ' -Force;';
If (pDebug = 0);
ExecuteCommand(sCommandPS, 1);
Endif;
576,CubeAction=1511
DataAction=1503
CubeLogChanges=0
930,0
638,1
804,0
1217,0
900,
901,
902,
938,0
937,
936,
935,
934,
932,0
933,0
903,
906,
929,
907,
908,
904,0
905,0
909,0
911,
912,
913,
914,
915,
916,
917,0
918,1
919,0
920,50000
921,""
922,""
923,0
924,""
925,""
926,""
927,""