The Macrium Reflect knowledgebase has been upgraded.
Please go here for the latest information.

Knowledgebase

v4: How to send backup completion emails with Macrium Reflect

Expand / Collapse
 

v4: How to send backup completion emails with Macrium Reflect



This article takes you through the steps required to send email notifications of backup completion status. Emails are sent using the VBScript generator in Macrium Reflect, and the VBScript source can easily be modified for SSL and SMTP authentication if required.



First you need to create an xml backup definition file and then follow the steps below :

  1. Right click on the xml file and select 'Generate a VBScript file'


  2. The following dialog is shown. Select the 'Email' option




    Click 'Enable Email Component' and enter your SMTP server and email address details.

    Attach log file to Email - This option attaches the log file from Reflect to the email that is sent.

    SMTP Server - This is the address for the email server that Macrium Reflect will use to send the email, this can be a FQDN such as smtp.domain.com, or an IP address, for example, 86.184.0.5

    From Email - This is the email address that will be sending the email, for example, backup@yourdomain.com.

    To Email - This is who you want to send the email to, you can enter multiple addresses like so: bob@yourdomain.com; bill@yourdomain.com;

    Success and Failure Tabs - These two tabs allow you to modify the content of the email by success or failure, the top box allows you to ammend the subject of the email, the bottom box allow you to modify the email content.
  3. You might want to explore the other options within the window to see if there are any you would want to enable or modify, then click 'OK'

    That's it!
    You should now get an email every time that you run the VBscript that you have created!


How do I run it?

To run VBScript source files from Macrium Reflect, click the VBScript tab, right click on the file and select 'Execute'. You can also schedule the script by taking the 'Schedule' option.



How to modify the generated VBScript to send email via GMail

Aftercreating the VBScript you can modify the source directly in notepad to add additional email settings. In this example we'll modify the settings to use GMail's SMTP server.

Note: You can easily change the settings outlined below to work with any SMTP server.

  1. Right click on the VBscript list entry, and select 'Edit'



    This will open up notepad with the VBScript for editing.

    Make sure you turn off 'Word Wrap' as this makes editing a lot easier.



  2. Scroll down until you see the following lines:

    '******************************************************************************
    '* Sub:     SendEmail
    '*
    '* Purpose: Uses CDO to send an email message
    '*
    '* Input:   strSubject      subject text
    '*          strBody         main body of the email
    '*          strLogFileName  file name of the log file to attach to the email
    '* Output:  None
    '*
    '******************************************************************************
    Function SendEmail(ByRef strSubject, _
    ByRef strBody,    _
    ByRef strLogFileName)
    Dim objMessage

    Set objMessage = CreateObject("CDO.Message")

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

    objMessage.Subject = strSubject
    objMessage.From = "from@mydomain.com"
    objMessage.To = "to@mydomain.com"
    objMessage.TextBody = strBody
    objMessage.AddAttachment strLogFileName
    objMessage.Send
    Set objMessage = nothing
    End Function

    The function 'SendEmail' contains all the source lines to send the email notification.
  3. Replace the following line:

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

    With:

    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=465
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1

    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")="user@gmail.com"
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")="gmail password"

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


    smtpauthenticate options are:  0 - No Authentication, 1 - Basic Authentication or 2 - NTLM authentication (Secure Password Authentication)
That's it!. Click 'File' > 'Save' in notepad. You can run andschedule VBScript source files just like your XML backup definitions.


Make sure you use a valid GMail account and password for the 'sendusername' and 'sendpassword' lines.



    Details
    Last Modified:18 Dec 2012

    Last Modified By: jon.dittman@macrium.com

    Type: Tutorial

    Article not rated yet.

    Article has been viewed 20,012 times.

    Options