Skip to content
Snippets Groups Projects
Commit 6733d609 authored by Papeleux Luc's avatar Papeleux Luc
Browse files

correct mailing functions in parametricJob.py for Py3

parent 5268d2ce
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,9 @@ class ParametricJob(PRMSet):
except:
text="file not found"
import smtplib
server = smtplib.SMTP(smtpServ)
server.sendmail(fromA, toA, head+text)
server = smtplib.SMTP(smtpServ)
server.sendmail(fromA, toA, (head+text).encode('ascii','ignore'))
#server.sendmail(fromA, toA, head+text)
server.quit()
def mailhtml(self, file, subject):
......@@ -77,7 +78,8 @@ class ParametricJob(PRMSet):
# getting address & smtp servers
fromA, toA, smtpServ = self.getMailData()
# building email
from email.MIMEText import MIMEText
#from email.MIMEText import MIMEText
from email.mime.text import MIMEText
file = open(file,'r')
text = file.read()
file.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment