close

Some my cognisance that apart from it person a swell trick, here isn't any physical realistic use for sending E-Mail from a book but lets create mentally the following scenario:

You have a business organization carping waiter named "ImpServ01" that must be going spare at all reimbursement. The shadowing letters can be setup to run all 5 report to scrutinize the availableness of the server and email you if the waiter becomes unattainable. This paradigm uses a SMTP waiter named "SMTP.YourDomain.com" and sends communication from "" to "".


Option Explicit

Post ads:
The Genesis of the GATT (The American Law Institute Reporters Studies on WTO Law)
Tinnitus Retraining Therapy: Implementing the Neurophysiological Model
Determinants of Animal Behaviour (Routledge Modular Psychology)
Virtual Geographies: Bodies, Space and Relations (Studies in Culture and Communication)
Luther (Lancaster Pamphlets)
The Global World of Indian Merchants, 1750-1947: Traders of Sind from Bukhara to Panama (Cambridge Studies in Indian History and Society)
Psychoanalytic Studies of the Personality
The Course of French History
Computerization in Developing Countries: Model and Reality
Creating an Internationally Competitive Economy
Ethics, Law, and Aging Review, Volume 9: Assuring Safety in Long Term Care: Ethical Imperatives, Legal Strategies, and Practical Limitations
The St. Lawrence River (Rivers in World History)
Chaperones (Topics in Current Genetics)
Amphetamines and Other Stimulants (Junior Drug Awareness)

Dim strComputer
Dim colPingStatus
Dim objPingStatus
Dim objMessage

strComputer = "ImpSrv01"

Set colPingStatus = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("SELECT * FROM Win32_PingStatus WHERE computer address = '" & strComputer & "'")

Post ads:
Complex Demonstratives: A Quantificational Account
Shifting Ground: The Changing Agricultural Soils of China and Indonesia
Dialyse und Nephrologie fur Fachpersonal 3. Auflage
Nachhaltigkeit und Gerechtigkeit: Grundlagen und schulpraktische Konsequenzen (Ethics of Science and Technology Assessment)
Metastable States in Amorphous Chalcogenide Semiconductors (Springer Series in Materials Science)
The Delta Model: Reinventing Your Business Strategy
Becoming Muslim: Western Women's Conversions to Islam (Culture, Mind and Society)
White Negritude: Race, Writing, and Brazilian Cultural Identity (New Concepts in Latino American Cultures)
Slave Songs and the Birth of African American Poetry
Entretien d'embauche : La methode pour reussir
The Sovereign Remedy?: Trade Agreements in a Globalizing World
The Physiology of the Novel: Reading, Neural Science, and the Form of Victorian Fiction
The Human Right to a Green Future: Environmental Rights and Intergenerational Justice
Ice Hunt

For Each objPingStatus In colPingStatus

If IsNull(objPingStatus.StatusCode) or objPingStatus.StatusCode 0 Then

Set objMessage = CreateObject("CDO.Message")

objMessage.From = strComputer & "@YourDomain.com"

objMessage.To = "Admin@YourDomain.com"

objMessage.Subject = strComputer & " is unavailable"

objMessage.Textbody = strComputer & " is no longer reachable complete the introduce yourself."

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP.YourDomain.com"

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

objMessage.Send

End If
Next

Set colPingStatus = Nothing
Set objMessage = Nothing

To connect a database to the E-Mail add the following line:


objMessage.AddAttachment "SomeDocument.doc"

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 lemaid 的頭像
    lemaid

    lemaid的部落格

    lemaid 發表在 痞客邦 留言(0) 人氣()