Send email using python script in Plone
If you dont want to hardcode the Mail Host id into your script and want to be able to send email to someone from within a (Script) Python this script will do it.
try: mailhost=getattr(context, context.superValues('Mail Host').id) except: raise AttributeError, "cant find a Mail Host object" mMsg = 'a testful email message n that contains a few line breaks. n ~runyaga' mTo = 'email@example.com' mFrom = 'firstname.lastname@example.org' mSubj = 'mail subject' mailhost.send(mMsg, mTo, mFrom, mSubj)
22nd November 2016
3rd December 2014
30th November 2014