Hi All,
Can anyone please suggest how to send an Email in TM1, Like a process has finished, user wants to know what are all the process has been finished. Give me examples how to Email in TM1 or any document regarding this.
Many people suggested to use the Third party software (I mean install the third party tool into TM1 server and execute), but I am not able to receive any email after following the instructions. Whenever I am trying to execute in command prompt, below error message pops up:
"TM1 server name sendemail.exe[150020]:ERROR => Received:
500 syntax error, command "XXXX TM1servername" unrecogni
zed
TM1 servername sendemail.exe [150020]:NOTICE => EHLO command fa
iled, attempting HELO instead
TM1 servername sendemail.exe [150020]: ERROR => Received:
554 Mail from (from email ID) rejected for policy reasons."
Any suggestions and solutions with steps is greatly appreciated.
Thanks
Chore status update (successful and unsuccessfull) to Email
-
- Posts: 10
- Joined: Thu Oct 07, 2010 1:55 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2 Fix pax 4
- Excel Version: 2013
-
- Community Contributor
- Posts: 219
- Joined: Mon Jul 23, 2012 8:31 am
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2010
Re: Chore status update (successful and unsuccessfull) to Em
I've been trying to get this to work as a VB Script called by TM1 but am waiting on our Desktop Support guys to give me the Exchange Server settings etc:
Code: Select all
'#-------------------------------------------------------------------------
'# FUNCTION.......: sendMail(strFrom, strTo, strSubject, strMail)
'# ARGUMENTS......: strFrom - Email Sender
'# strTo - Email recipient
'# strSubject - Email subject
'# strMail - Email body
'# PURPOSE........: Sends email from a script
'# EXAMPLE........: sendMail "scriptTest@gmail.com", _
'# "recipient@emailAddress.com", _
'# "sendMail Function Test", _
'# "This is a test of the sendMail Function."
'#
'# NOTES..........: For this to work, you must define the variable
'# "oMailServer" on line 1 of the actual Function. This
'# must be set to a valid email server that will accept
'# unauthenticated email from your machine (if you host
'# Exchange onsite, it will do this by default).
'#
'# To add an attachment add this code above the Function
'# call:
'# strAttachment = "c:\yourAttachment.txt"
'# strMailFile = 1
'#
'# If there are two attachemnts, add this code before
'# the Function call:
'# strAttachment = "c:\yourAttachment.txt"
'# strAttachment2 = "c:\yourAttachment2.txt"
'# strMailFile = 2
'#
'#-------------------------------------------------------------------------
Function sendMail(strFrom, strTo, strSubject, strMail)
oMailServer = "your.mail.server.com"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = strFrom
objEmail.To = strTo
objEmail.Subject = strSubject
objEmail.Textbody = strMail
If strMailFile = 1 Then
objEmail.AddAttachment strAttachment
End If
If strMailFile = 2 Then
objEmail.AddAttachment strAttachment
objEmail.AddAttachment strAttachment2
End If
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
oMailServer
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
= 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Function
-
- MVP
- Posts: 352
- Joined: Wed May 14, 2008 1:37 pm
- OLAP Product: TM1
- Version: 2.5 to PA
- Excel Version: Lots
- Location: Sydney
- Contact:
Re: Chore status update (successful and unsuccessfull) to Em
You'll find plenty of solutions if you search the forum for EMail.
Andy Key
-
- Posts: 10
- Joined: Thu Oct 07, 2010 1:55 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2 Fix pax 4
- Excel Version: 2013
Re: Chore status update (successful and unsuccessfull) to Em
Hi,
Thanks to Andy and RJ for your reply.
At last, I have completed this task half way, which means I have prepared TWO batch files (one for “Successful” and another for “Unsuccessful”). But, when I wrote the TI Process to execute these batches then they are not working, Please find the below explanation in detail:
- When I execute batch files manually (which means just double click the batch files) then I am receiving emails (One for successful and another for Unsuccessful) to my account.
- When I had written the below coding in Prolog tab (4 different ways) then I am not receiving any email to my account. Here I am planning to write the coding as If condition to satisfy only one batch files (successful or unsuccessful). Please see below coding:
Way 1:
------------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult = 0;
Set = EXECUTEPROCESS('ProcessName');
IF (Set = ProcessExitNormal());
vResult = 1;
ENDIF;
IF(vResult = 1);
# If it successful
vCommandLine = 'Path of successful.bat';
ELSE;
# If it Failed
vCommandLine = 'Path of Unscuccessful.bat';
ENDIF;
ExecuteCommand(vCommandLine, 0);
Way 2:
----------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
return_Value = ExecuteProcess('processname');
IF(return_Value = ProcessExitSeriousError() );
#If it failed
vCommandLine = 'path of Failed.bat';
ELSE;
#It it success
vCommandLine = 'path of Successful.bat';
ENDIF;
ExecuteCommand(vCommandLine, 0);
Way 3:
---------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult = 0;
Set = EXECUTEPROCESS('processname);
IF (Set = ProcessExitNormal());
vResult = 1;
ENDIF;
IF(vResult <> 0);
# It if success
vSuccess = 'path of successful.bat';
ExecuteCommand(vSuccess,0);
ELSE;
# If it failed
vFailure = 'path of failure.bat';
ExecuteCommand(vFailure,0);
ENDIF;
Way 4:
----------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult=0;
pcube = Dummy_Process';
set1 = EXECUTEPROCESS('process name');
CELLPUTS(TIMST(NOW, '\Y-\M-\d \h:\i:\s'), pcube,'Subset Update', 'Time');
IF(set1=ProcessExitNormal());
CELLPUTN(1,pcube,'Subset Update','Count');
ENDIF;
set2 = EXECUTEPROCESS('saveDataAll');
CELLPUTS(TIMST(NOW, '\Y-\M-\d \h:\i:\s'), pcube, 'SaveDataAll', 'Time');
IF(set2=ProcessExitNormal());
CELLPUTN(1,pcube,'saveDataAll','Count');
ENDIF;
IF(CELLGETN('Dummy_Process','All','Count')=2);
vResult=1;
ENDIF;
IF(vResult =1);
# If it Successful
vCommandLine = 'path of successful.bat';
ELSE;
# If it Failed
vCommandLine = 'path of failed.bat';
ENDIF;
ExecuteCommand(vCommandLine,0);
----
Any suggestions are greatly appreciated...
Thanks to Andy and RJ for your reply.
At last, I have completed this task half way, which means I have prepared TWO batch files (one for “Successful” and another for “Unsuccessful”). But, when I wrote the TI Process to execute these batches then they are not working, Please find the below explanation in detail:
- When I execute batch files manually (which means just double click the batch files) then I am receiving emails (One for successful and another for Unsuccessful) to my account.
- When I had written the below coding in Prolog tab (4 different ways) then I am not receiving any email to my account. Here I am planning to write the coding as If condition to satisfy only one batch files (successful or unsuccessful). Please see below coding:
Way 1:
------------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult = 0;
Set = EXECUTEPROCESS('ProcessName');
IF (Set = ProcessExitNormal());
vResult = 1;
ENDIF;
IF(vResult = 1);
# If it successful
vCommandLine = 'Path of successful.bat';
ELSE;
# If it Failed
vCommandLine = 'Path of Unscuccessful.bat';
ENDIF;
ExecuteCommand(vCommandLine, 0);
Way 2:
----------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
return_Value = ExecuteProcess('processname');
IF(return_Value = ProcessExitSeriousError() );
#If it failed
vCommandLine = 'path of Failed.bat';
ELSE;
#It it success
vCommandLine = 'path of Successful.bat';
ENDIF;
ExecuteCommand(vCommandLine, 0);
Way 3:
---------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult = 0;
Set = EXECUTEPROCESS('processname);
IF (Set = ProcessExitNormal());
vResult = 1;
ENDIF;
IF(vResult <> 0);
# It if success
vSuccess = 'path of successful.bat';
ExecuteCommand(vSuccess,0);
ELSE;
# If it failed
vFailure = 'path of failure.bat';
ExecuteCommand(vFailure,0);
ENDIF;
Way 4:
----------------------------------
§ No Data source
§ No Variable declaration
§ In Prolog Tab
vResult=0;
pcube = Dummy_Process';
set1 = EXECUTEPROCESS('process name');
CELLPUTS(TIMST(NOW, '\Y-\M-\d \h:\i:\s'), pcube,'Subset Update', 'Time');
IF(set1=ProcessExitNormal());
CELLPUTN(1,pcube,'Subset Update','Count');
ENDIF;
set2 = EXECUTEPROCESS('saveDataAll');
CELLPUTS(TIMST(NOW, '\Y-\M-\d \h:\i:\s'), pcube, 'SaveDataAll', 'Time');
IF(set2=ProcessExitNormal());
CELLPUTN(1,pcube,'saveDataAll','Count');
ENDIF;
IF(CELLGETN('Dummy_Process','All','Count')=2);
vResult=1;
ENDIF;
IF(vResult =1);
# If it Successful
vCommandLine = 'path of successful.bat';
ELSE;
# If it Failed
vCommandLine = 'path of failed.bat';
ENDIF;
ExecuteCommand(vCommandLine,0);
----
Any suggestions are greatly appreciated...
-
- Community Contributor
- Posts: 349
- Joined: Tue Aug 17, 2010 6:31 am
- OLAP Product: Planning Analytics
- Version: 2.0.5
- Excel Version: 2016
Re: Chore status update (successful and unsuccessfull) to Em
There are a couple of freeware 3rd party SMTP emailers as well. Blat.exe is one of them that works well and can send html and attachments through SMTP as well.
You don't really need a .bat file if you use a compiled program as well. I would say its better to design a Master TI Process called SendEmail or something like that and simply setup all the parameters there and code there. Then any time you need to send an email you simply call your TI called SendEmail.
You don't really need a .bat file if you use a compiled program as well. I would say its better to design a Master TI Process called SendEmail or something like that and simply setup all the parameters there and code there. Then any time you need to send an email you simply call your TI called SendEmail.