‎14-03-2022 09:20 AM
Hi community.
I'm using this macro:
Sub testDate()
Dim colApplis, oAppli, cpt, strResult, myDate
Dim total as integer
sum = 0
Set colApplis = megaEnv.getRoot.getCollection("~FN8AHc2gITnL[Software Technology]")
For Each oAppli In colApplis
myDate = oAppli.getProp("~1RLnmMCJX9ZK[Fecha Fin]")
If myDate <> "" Then'
total = CDate(myDate) - Date
If total <= 90 Then
sum = sum + 1
strResult = strResult & " - " & oAppli.getProp("short name") & vbLf
End If
End If
Next
If sum > 0 Then
Dim msg as String
msg = "Check these: " & sum & "," & _
" software Technology:" & vbLf & strResult
MsgBox msg
End If
End Sub
Call testDate
It works fine, it counts the Software Technology elements, but my question is, How can i send the result of that macro (pop-up that shows a list of software technology elements) as email? which is the best way to do that?
‎15-03-2022 10:43 PM - edited ‎16-03-2022 07:23 PM
Hello,
please remember to always tell us the version of Hopex you are using.
If you have correctly parameterized everything (screenshot concerns a V3 version) :
Then you can easily send an email. Here is an example of function you could call :
Function sendAlert(oRoot, msg)
Dim objMailSender
Set objMailSender = oRoot.CurrentEnvironment.Toolkit.MegaMailSender
objMailSender.Subject = "Your subject for this email"
objMailSender.Body = msg
objMailSender.Recipients.Insert "yourrecepient1@fabrica.com"
objMailSender.Recipients.Insert "yourrecepient2@fabrica.com" 'Add as many as you want
objMailSender.SmtpSend
End Function