oquidave

pass to python

May 25th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. /*
  3. * send arguments to a python script from php and send mail to specified recipient
  4. */
  5. //first value is the '$to' value and second is '$body'
  6. $body = 'this is from cmd';
  7. $cmd = "python sendmail.py '$to' '$body'";
  8. if(shell_exec($cmd)){
  9. print "successfully fireup python mail script";
  10. } else {
  11. print "failed to fireup python mail script";
  12. }
  13.  
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment