send and email after deployment in jython

Hi,

Can anybody give me a script to send an email after deployment in jython. I want to include as a function in my existing install script.
sweety_745Asked:
Who is Participating?
 
HonorGodSoftware EngineerCommented:
Something like this should work for you:
import smtplib

sender    = 'me@mydomain.com'
receivers = ['you@yourdomain.com']

message = """From: Me <me@mydomain.com>
To: "You" <you@yourdomain.com>
Subject: SMTP e-mail test

This is a test e-mail message.
"""

try:
   smtpObj = smtplib.SMTP( 'localhost' )
   smtpObj.sendmail( sender, receivers, message )         
   print 'Message sent successfully.'
except SMTPException:
   print 'Error: unable to send message'

Open in new window

0
 
sweety_745Author Commented:
This worked too. U are a Genious!!
0
 
HonorGodSoftware EngineerCommented:
Thanks for the grade, points, and compliments. ;-)

Good luck & have a great day.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.