Declare Function NetMessageBufferSend Lib "netapi32.dll" ( _ ByVal sNullParam As String, ByVal pszServer As String, ByVal pszRecipient As String, _ ByVal pbBuffer As String, ByVal cbBuffer As Long) As Long
Function SendMsg(sToDomn As String, sFromWho As String, _ sToWho As String, sTheMsg As String) As Boolean
Dim lReturn As Long Dim sToMachine As String * 256 Dim sToDomain As String Dim sFrom As String * 256 Dim sMessage As String * 256 Dim lLength As Long
SendMsg = False lLength = 256 sToMachine = StrConv(sToWho & vbNullChar, vbUnicode) sToDomain = StrConv(sToDomn, vbUnicode) + vbNullChar sFrom = StrConv(sFromWho & vbNullChar, vbUnicode) sMessage = StrConv(Left$(sTheMsg, 256) & vbNullChar, vbUnicode)
lReturn = NetMessageBufferSend(sToDomain, sToMachine, sFrom, sMessage, lLength)
If lReturn = 0 Then SendMsg = True End If End Function |