How to send email utilizing python code from Jenkins job? I have SMTP configuration with Groovy-DSL "emailext", I can accomplish it; But trying to see the same with python code.
Simple example:
import smtplib
sender = "sender@domain.com"
receivers = "receivers@domain.com"
message = """
Stack Overflow!
"""
try:
smtp_obj = smtplib.SMTP('localhost')
smtp_obj.sendmail(sender, receivers, message)
print "Done"
except SMTPException:
print "error"
You can read this
https://www.tutorialspoint.com/python/python_sending_email.htm
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.