Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CognosScript editor --> sending report using ms outlook 1

Status
Not open for further replies.

JanHumanitas

Technical User
Feb 14, 2008
8
NL
Hello,

I've made a script that generates and saves a report. Is there a function in CognosScript editor that can send this report by e-mail (outlook)?

Otherwise I have to add such a function in the cmd file that runs the macro. But it would be nice when I can add this function in the script..

Thanx.
Jan
 
Jan,
The problem with Outlook is that recent versions tend to view the CognosScript automation as an unwarranted process (virus/trojan/malware etc) and pop up a window to authenticate. To get around this, you could use CDONTS (CDO for NTS) and SMTP to send the mail to your Exchange server.
Check SMTP availability in Windows Services, or add it to IIS. Also, your Exchange server may need to be set to allow relay from your Cognos server - check with your Exchange person - as most companies will lock down possible spam routes.

(NB: Windows 2003 server no longer has CDONTS as part of the install - MS switched to CDOSYS, but you can copy it over from a 2000 server and register the .dll)

Code:
   Dim objEmail as Object
   Set objEmail = CreateObject("CDONTS.NewMail")
   with objEmail
      .To = "Jan@Humanitas.com"
      .From = "CognosServer@Humanitas.com"
      .Subject = "Today's reports"
      .Body = "Now served up. Enjoy!"
      .MailFormat = 0 
      .Send
   End with
   set Email = nothing




soi la, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top