Dear everyone, I have an shutdown python scripts which basically sends email to admin after one datadownload has been succeed or failed. My existing py script is as follows:
I now want to impose one "if" condition before email generate, if my user name is "A" and email is "A@nnn.com" then email will not generate.. I have ended my script as follows but it did not work, FME server shows me error.
if nutzer != 'A' AND user_mail != 'A@nnn.com':
smtpserver = smtplib.SMTP(smtpServerAdress,smtpPort)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.sendmail(emailFrom, emailTo, msg.as_string())
smtpserver.close()
...............
Did I have done some mistakes?
And another issue is, I want to also store the result inside sql server DB , how i can write the right script before'send mail?
Thanks
Muqit