Script:Lib Comm
Un article de MacodaWiki.
lib_comm.vbs : Permet d'envoyer des emails, des SMS, ... de façon standard et facile.
' ####################################################
'*-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-*
'* LIBRAIRIE *
'* LIB_LOG *
'* *
'* Inclure cette librairieen début de script grâce à la commande #include lib\lib_log.vbs *
'* *
'* Attention cette librairie est à inclure en premier car elle contient le Option explicit *
'* *
'* 2006/08/01 *
'* *
'*-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-**-*-*-*-*-*-*-*
#include ..\..\config\donnees_perso.inc
'*****************************************************************************
' FCT_Determine_Adresse
Function FCT_Determine_Adresse (iDestination)
gFct_Log_LIB LOG_BAVARD, "entrée dans FCT_Determine_Adresse ("&CStr(iDestination)&")"
FCT_Determine_Adresse = gTab_Mail(iDestination)
End function
'*****************************************************************************
' FCT_Mail
Sub FCT_Mail(iDestination,sSujet,sTexte)
Dim sAdresse
sAdresse = FCT_Determine_Adresse (iDestination)
gFct_Log_LIB LOG_BAVARD, "Expédition d'un email à >"&sAdresse&"<"
hs.SendEmail sAdresse,"domotique@macoda.com",sSujet,sTexte
End Sub
'*****************************************************************************
' FCT_Sms
Sub FCT_Sms(iDestination,sSujet)
Dim sAdresse
gFct_Log_LIB LOG_BAVARD, "Expédition d'un SMS !!"
FCT_Mail iDestination,sSujet,""
End Sub
'*****************************************************************************
' gFCT_COMM
Sub gFCT_COMM (iDestination,sSujet,sTexte)
If (iDestination = MAIL_PERSO_DAVID) or (iDestination = MAIL_PERSO_CORINNE) or (iDestination = MAIL_BOULOT_DAVID) Then
FCT_Mail iDestination,sSujet,sTexte
elseif (iDestination = SMS_DAVID) or (iDestination = SMS_CORINNE) Then
FCT_Sms iDestination,sSujet
Else
gFct_Log_ERR "iDestination ("&CStr(iDestination)&") ne correspond pas à une destination possible"
End if
End Sub
