6 Replies Latest reply on Mar 28, 2019 10:20 AM by Bulent.Yildiz-Oracle

    How to send an email from the HFM Rules

    Bulent.Yildiz-Oracle

      Hi experts,

      Has anyone achieved this On-Prem or OMCS? I am planning to trigger this using an on-demand rule, but not sure where to start.

       

      Thanks to all for any ideas, opinions, recommendations and working solutions you may have.

      Bulent

        • 1. Re: How to send an email from the HFM Rules
          ericerikson

          Hi. Suggest you search on Amazon.

           

          Eric

          1 person found this helpful
          • 2. Re: How to send an email from the HFM Rules
            user6692921

            Hi Bulent

             

            This is the code I use for sending an email from the Allocate function:

             

                       intSendUsing = 2

                        intSMTPPort = 25

               

                        ' Don't want any errors to hold up the process

                        On Error Resume Next

                           

                        'Create CDO configuration object

                        Set objConfig = CreateObject("CDO.Configuration")

                        'Set Config object settings

                        With objConfig.Fields

                            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = intSendUsing

                            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer

                            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = intSMTPPort

                            .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10

                            .Update

                        End With

               

                        'Create CDO message object

                        Set objMsg = CreateObject("CDO.Message")

                        'Assign config object to configuration property of message object

                        Set objMsg.Configuration = objConfig

                        'Set Message object settings and send mail

                        With objMsg

                            .To = strToAddress

                            .CC = strCCAddress

                            .From = strFromAddress

                            .Subject = strSubject

                            .TextBody = strEmailMsgLine

                            .Send

                        End With

                       

                        'Destroy message objects

                        Set objMsg = Nothing

                        Set objConfig = Nothing

            1 person found this helpful
            • 3. Re: How to send an email from the HFM Rules
              Bulent.Yildiz-Oracle

              Hello,

              Thank you for this. Using the CDO method, do you know if the email goes through the Microsoft servers? This may be a problem if I need to include some financial figures in the email.

               

              Regards

              Bulent

              • 4. Re: How to send an email from the HFM Rules
                Bulent.Yildiz-Oracle

                Hi Eric,

                I have seen your book about sending emails from HFM rules on Amazon. I have found some code on the internet (CDO / Outlook object) alsouser6692921 shared a sample code using CDO object. Is your book offering any other useful information and/or methods? I am happy to purchase it if it does. I'd appreciate if you could let me know.

                 

                Thanks

                Bulent

                • 5. Re: How to send an email from the HFM Rules
                  user6692921

                  Hi Bulent

                   

                  The email will not go through Microsoft servers unless your SMTP server is a Microsoft server. SMTP is essentially a folder which is monitored by the SMTP service. An SMTP email is a file in a particular format which is copied to a set folder on the SMTP Server. The SMTP Service picks up the file and reads the email properties and then sends the email from the server itself.

                   

                  SMTP does not require any software installation as it is a folder that is being monitored. If you want to go down the Outlook route you will need to have mail client software installed i.e. you need to install Outlook on your HFM servers. Or replicate the SMTP setup by copying the email as a text file to another server which has Outlook installed and monitor the folder.

                   

                  HTH

                  1 person found this helpful
                  • 6. Re: How to send an email from the HFM Rules
                    Bulent.Yildiz-Oracle

                    Thanks HTH,

                    This is good to hear. It would be great to have some kind of proof of this (e.g. a document or website explaining how CDO works). I have googled for this but couldn't find much about how the data (email and config data) flows using CDO.

                     

                    Code like "http://schemas.microsoft.com/cdo/configuration"  may make it look like some of the information is being recorded in the Microsoft databases. 

                     

                    Regards

                    Bulent