Sending email using TI process

Post Reply
dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Sending email using TI process

Post by dilip »

I need a sample code or any URL to send email using TI process....Please help me on this learning part.

I have an attachment of file,smtp servername...but dont know the procedure to write ...
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Sending email using TI process

Post by jim wood »

Did you try to search here or even google this? There are at least 5-10 threads that cover this is great detail on this site alone.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Sending email using TI process

Post by dilip »

Yes I googled..But not reaching the exact code what i need..I am getting in bits...sometimes i get email notification configuration..which i dont need....sometimes so much lenghty code which is difficult to understand for me. Iam beginner..
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Sending email using TI process

Post by jim wood »

There is no email function within TM1. You have build something in from outside. That is why the code may seem a little on the complicated side.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Sending email using TI process

Post by dilip »

dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Sending email using TI process

Post by dilip »

arguments = 'CScript C:\sendMailOther.vbs '|sSMTPSvr |' ' | sSender | ' "'|pRecipient|'" "'|pSubject|'" "'
| sFileName | '"' ;
ENDIF;


I got this code but here what is "sendMailOther.vbs" which is confusing me...pls help
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Sending email using TI process

Post by declanr »

Earlier in the same post is the vb script which needs to be set up.

If you are struggling with that go the easier route and download something like sendmail.exe or BLAT; then all you have to do is pass parameters to the executable.
Declan Rodger
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Sending email using TI process

Post by rmackenzie »

declanr wrote:If you are struggling with that go the easier route and download something like sendmail.exe or BLAT; then all you have to do is pass parameters to the executable.
Nowadays, the Powershell option is much easier as it is a default install for a modern Windows OS and has in built e-mail capabaility that is easily accessible from a few lines of TI. With this method there's no need to manage separate executables or scripts and their locations etc. E.g.:

Code: Select all

sFrom = 'tm1@yourcompany';
sTo = 'robin.mackenzie@somewhere.com';
sSubject = 'test';
sBody = 'test';
sSmtpServer = 'name of your smtp server';

# build powershell command
sPsCmd = '"& {
Send-MailMessage 
-From ' | sFrom | ' 
-To ' | sTo | ' 
-Subject ' | '\"' | sSubject | '\"
-Body ' | '\"' | sBody | '\"
-SmtpServer ' | sSmtpServer | ' 
}"';

# execute command
ExecuteCommand ( 'powershell.exe -command ' | sPsCmd, 1 );
Robin Mackenzie
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Sending email using TI process

Post by declanr »

Nice and straightforward; I like it.
Declan Rodger
dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Sending email using TI process

Post by dilip »

Thanks everyone on this post...I was able to do via TI process...using sendmail.exe....and it worked..
This powershell I have done already..I have done in my last project using powershell,but I was learning to do via TI processs.
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Sending email using TI process

Post by declanr »

dilip wrote:This powershell I have done already..I have done in my last project using powershell,but I was learning to do via TI processs.
RMackenzie's powershell solution would still be called from a TI process; and its the same concept with sendemail.exe where you are relying on something external to TM1 and passing pretty much the exact same parameters - so the amount of "TM1" involved in either would be approximately the same.
Declan Rodger
dilip
Posts: 128
Joined: Thu Dec 15, 2011 8:22 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Sending email using TI process

Post by dilip »

Is it declanr!!.....Then I will try definately using powershell with TI process Thanks...This will be good idea...

Thanks Rmackenzie and declanr
Post Reply