title: I want to send a mail from shell-script to external mail id
body: <p>After a successful execution of a bash-script I need to send a mail to other domain, without a mail configure in the sender machine.</p>
  
  <p>If it possible to execute a python script inside a bash-script for sending mail with bash variables?</p>
  
  <p>Or any other way to share the same variables from a shell-script to a python script?</p>
  
  <p>I found a python script for sending mail,</p>
  
  <pre><code>#!/usr/bin/python    
  from smtplib import SMTP
  import datetime
  debuglevel = 0
  
  smtp = SMTP()
  smtp.set_debuglevel(debuglevel)
  smtp.connect('192.168.75.1', 25)
  smtp.login('my_mail', 'mail_passwd')
  
  from_addr = "My Name &lt;my_mail@192.168.75.1&gt;"
  to_addr = "&lt;my_mail@192.168.75.1"
  subj = "Process completed"
  date = datetime.datetime.now().strftime( "%d/%m/%Y %H:%M" )
  #print (date)
  message_text = "Hai..\n\nThe process completed."
  
  msg = "From: %s\nTo: %s\nSubject: %s\nDate: %s\n\n%s" % ( from_addr, to_addr, subj, date, message_text )
  
  smtp.sendmail(from_addr, to_addr, msg)
  smtp.quit()
  </code></pre>
  
  <p>But I need to execute this on the same script, because the bash-script parameters must be the body of the mail.</p>