Answer Upon
#1 in Business Subscribe Email Print

You are here: Home > Computers and Technology > Computers and Technology > VBScript - Send E-Mail with CDO.Message

Tags

  • engine
  • colpingstatusif
  • network marketing
  • network marketing
  • thenset objmessage

  • Links

  • To Egg Or Not To Egg Is The Vegetarian Question
  • National Parks - Get Out of Your Car!
  • Cell Phone GPS Tracking - Privacy Issues
  • Answer Upon - VBScript - Send E-Mail with CDO.Message

    How to Schedule a Book Signing
    How would you like to sell more copies of your book? Would you like to read excerpts from your book to a captivated audience?Book signings are the cornerstone of an author's post-publication foundation. But how do you set them up?Organiz
    /p>

    objMessage.Textbody = strComputer & " is no longer accessible over the network."

    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" Effective Search Engine Optimisation Firm
    If you are keeping a track on internet and online advertising then you must have heard the buzz surrounding Search Engine Optimisation. Search Engine Optimisation is one of the growing and expanding sectors and this expansion has led to the emergence

    Some my feel that apart from it being a nifty trick, there isn’t any real practical use for sending E-Mail from a script but lets imagine the following scenario:

    You have a business critical server called "ImpServ01" that must be available at all costs. The following script can be setup to run every five minutes to check the availability of the server and email you if the server becomes unavailable. This example uses a SMTP server called "SMTP.YourDomain.com" and sends mail from "ImpServ01@YourDomain.com" to "Admin@YourDomain.com".

    Option Explicit

    Dim strComputer Dim colPingStatus Dim objPingStatus Dim objMessage

    strComputer = "ImpSrv01"

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

    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 accessible over the network."

    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"

    Optimization, Over-Optimization, or SEO Overkill?
    The fight to top search engines' results knows no limits – neither ethical, nor technical. There are often reports of sites that have been temporarily or permanently excluded from Google and the other search engines because of malpractice and using “b
    heck the availability of the server and email you if the server becomes unavailable. This example uses a SMTP server called "SMTP.YourDomain.com" and sends mail from "ImpServ01@YourDomain.com" to "Admin@YourDomain.com".

    Option Explicit

    Dim strComputer Dim colPingStatus Dim objPingStatus Dim objMessage

    strComputer = "ImpSrv01"

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

    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 accessible over the network."

    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" Subprime Mortgage Loans - 3 Questions To Ask Your Subprime Mortgage Broker
    Subprime mortgage brokers offer a variety of mortgage loan packages from different lending companies. They can find financing for almost anyone, regardless of their credit score. Even though brokers offer a valuable service, you still need to ask quesmain.com".

    Option Explicit

    Dim strComputer Dim colPingStatus Dim objPingStatus Dim objMessage

    strComputer = "ImpSrv01"

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

    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 accessible over the network."

    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" 7 Things You Can Do to Make Search Engines Fall Head Over Heels in Love With Your Small Biz Website
    Creating your own small business website can be a scary thing to do. It requires some planning to get it right and make search engines sit up and take notice of your site at first glance. Small business website search engine optimization (SEO) is one ch 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 accessible over the network."

    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" Why 95% of MLM or Network Marketing People Fail with Their Home Based Business
    Every MLM or network marketing operation offers the same promises for their home based business of being easy to operate, no real skills required, huge earnings potential, retire on a rising passive income in as little as 5 years and have a greater qu/p>

    objMessage.Textbody = strComputer & " is no longer accessible over the network."

    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 attach a file to the E-Mail add the following line:

    objMessage.AddAttachment "SomeDocument.doc"

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.hubyou.info/article/169618/hubyou-VBScript--Send-EMail-with-CDOMessage.html">VBScript - Send E-Mail with CDO.Message</a>

    BB link (for phorums):
    [url=http://www.hubyou.info/article/169618/hubyou-VBScript--Send-EMail-with-CDOMessage.html]VBScript - Send E-Mail with CDO.Message[/url]

    Related Articles:

    Entrepreneurship: What does it REALLY mean?

    What Is Collaborative B2B E-Commerce

    BlogTV for Passion Blogger's

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com