Solved

Using Blat in Python

Posted on 2010-09-15
3
1,514 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
ID: 33685844
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
ID: 33693203
This is just what i needed.

Thanks
0
 

Author Closing Comment

by:huskeraider
ID: 33693219
Outstanding.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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 …

839 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