Plain text email has new characters instead of formatting

10 views
Skip to first unread message

anse...@gmail.com

unread,
Mar 22, 2018, 9:20:10 AM3/22/18
to StackStorm
Greetings,

I am encountering one problem with one of my action in stackstorm where email formatting still has newline characters. It is python runner where I send email in plain-text or html format, depending on input:

  def run(self, toEmail, fromEmail, body, subject, isHTML=False, ccEmail=None):

    '''

    Run method to send email.

    '''

    smtpObj = smtplib.SMTP('localhost')

    if isHTML:

      message = MIMEText(str(body), 'html')

    else:

      message = MIMEText(body, "plain")

    message['To'] = toEmail

    message['From'] = fromEmail

    message['Subject'] = subject

    message['cC'] = ccEmail

    smtpObj.sendmail(fromEmail, [toEmail, ccEmail], message.as_string())


Has anyone seen this issue before in Stackstorm? Any help is appreciated.


Thanks

Anand S.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages