robotframework - Email Notification for test results by using Python in Robot Framework -


we using robot framework execute automation test cases. please guide me write script e-mail notification of test results.

note: have e-mail server details.

regards, -kranti

i use smtplib , mimetext

import smtplib email.mime.text import mimetext  class emailclient():      def __init__(self, my_address):         self.my_address = my_address      def send(self, message, subject, user, email):          header = "hello " + str(user) + ",\n\n"         footer = "\n\n-your boss"         msg = mimetext(header + message + footer)          msg['subject'] = subject         msg['from'] = self.my_address         msg['to'] = email          s = smtplib.smtp('localhost')         s.sendmail(self.my_address, [email], msg.as_string())         s.quit()  eclient = emailclient("myemail@university.edu") eclient.send("this test email", "test subject", "john doe", "jdoe@university.edu") 

Comments