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.

    mailhost=getattr(context, context.superValues('Mail Host')[0].id)
    raise AttributeError, "cant find a Mail Host object"

mMsg = 'a testful email message n that contains a few line breaks. n ~runyaga'
mTo = ''
mFrom = ''
mSubj = 'mail subject'

mailhost.send(mMsg, mTo, mFrom, mSubj)


  1. Hi,

    If i want to send a email using python on Plone and also want to cc some folks what is the function i should be using to do the same. I understand that mailhost.send or mailhost.simple_send would not allow me to cc somebody!

    Thanks in advance

  2. I can’t see any functionality in this function to send multiple mail. But you can try add-on products for this. Have a look these products I have listed below find the best according to your requirements.


Leave a Reply

Your email address will not be published. Required fields are marked *