Solved

Using Blat in Python

Posted on 2010-09-15
3
1,476 Views
Last Modified: 2012-05-10
Does anyone have an example of using Blat in a Python script. I would like to get a fail or success notify when the script finishes. I'm sure there are better alternatives but with my limited skill i figured blat would be the easiest to master.

thanks,
0
Comment
Question by:huskeraider
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
-Richard- earned 250 total points
Comment Utility
Blat allows you to send emails directly from the ommand line, so for a simple success notification, the following should work from within Python:

import os
os.system('blat.exe - -f from@example.com -to to@somewhere.com -s Subject -body "Success!" -server smtp.example.com:25 -u username -pw password ')

Please note there is also a "subprocss" library which is a more sophisticated way to execute command-line programs, but I sense your needs are rather simple and os.system should suffice.
0
 

Author Comment

by:huskeraider
Comment Utility
This is just what i needed.

Thanks
0
 

Author Closing Comment

by:huskeraider
Comment Utility
Outstanding.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Variable is a place holder or reserved memory locations to store any value. Which means whenever we create a variable, indirectly we are reserving some space in the memory. The interpreter assigns or allocates some space in the memory based on the d…
This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now