I want to get ModelBuilder to email me the results of processes at certain stages so that if there are issues I can remotely login and deal with them as I do with python scripts. I have a python based tool to email the results but don't see a way to get results from individual processes. You can right-click on a process in ModelBuilder and view results but how can I get this info to be passed into the email script?

Worst case scenario - I guess I can export the model to python and add the emailer script but is there an easier way?

enter image description here

Model Code -this is a simple model to test. The main model to use this on will run over a weekend or more as the raster-polygon take about 6 hours for some tiles.

# ---------------------------------------------------------------------------
# model_emailstatus.py
# Created on: 2011-10-11 16:28:25.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Load required toolboxes

# Local variables:
Key_Resource_Area_shp = "O:\\2011\\11\KeyResourceArea.shp"
Key_Resource_Separation_Area_shp = "O:\\2011\\1121\SeparationArea.shp"
Message = ""

This is what I want to fill...in python it would be just Message = arcpy.GetMessages() but what does the same thing in model builder?

Email = "georgec@xxxxxxxx"
Success = ""

How do I fill this with true/false depending on if the merge tool is successful or not?

KeyResourceArea_Merge = "C:\\Users\\georgec\\Documents\\ArcGIS\\Default.gdb\\KeyResourceArea_Merge"

# Process: Merge

# Process: EmailStatus
arcpy.gp.toolbox = "D:/SCRATCH/Projects/106/Toolbox.tbx";
# Warning: the toolbox D:/SCRATCH/Projects/106/Toolbox.tbx DOES NOT have an alias. 
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.EmailStatus(...) with arcpy.EmailStatus_ALIAS(...)
arcpy.gp.EmailStatus(Message, Email, Success)

2 Answers 2


I'd probably ditch ModelBuilder, or at least call your models from Python, and use the logging module with an SMTPHandler to email you any critical messages.

  • yup...I just hope that I don't have to do this. Surely there must be a way to capture the progress info from a tool that is running in model builder?
    – GeorgeC
    Commented Oct 11, 2011 at 6:54
  • 4
    Normally (unless you are running a geoprocessing server tool) either it will run successfully or it will produce an exception. All you can really do is log everything and email the exceptions so you know that something went wrong.
    – blah238
    Commented Oct 11, 2011 at 7:21

I am in agreement with @Blah238 (best to do logging and emaiing via Python), but want to point out that there are a couple Python scripts on the ArcGIS Geoprocessing Resource Center that already have the bones of logging and emailing set up and may help jumpstart the process for you.

  • Thanks...I guess I'll just have to use python. I accepted blah238's answer as he responded first but Ryan thanks for the extra info. I have the python email tool already but the extra functions in the ESRI scripts will be useful. Best.
    – GeorgeC
    Commented Oct 12, 2011 at 0:54
  • Agreed, I just wanted to pass along some links that might be helpful to other users, which don't fit nearly as well in the comments box. Commented Oct 12, 2011 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.