Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Python script for emailing not working

Hello, I have written a python 3 script that send an email using a SMTP from my company. The script is working fine in my laptop running on python 3 so there shouldn't be any error on it.

The problem is that it's not working on matillion's Python component. I used the python 3 as interpreter and the same code. What could be the reasons for not be working on Matillion?

4 Community Answers

Alejandro Sanchez —

Sorry, I forgot to paste the python code:


import smtplib
from email.message import EmailMessage
s = smtplib.SMTP(host='SMTP Address', port=25)
s.starttls()
s.login('USER', 'PASSWORD')
msg = EmailMessage()
me = 'SAME_USER'
you = 'example@hotmail.com'
msg.set_content('Some of the tables failed to be loaded')
msg['Subject'] = 'OData loading failed'
msg['From'] = me
msg['To'] = you
s.send_message(msg)
s.quit()


Matillion Agent  

Laura Malins —

Hi Alejandro

What’s the error message you get? This runs without an issue for me.

Thanks
Laura


Alejandro Sanchez —

Hi Laura

The error that I get when I run the component is:

Script killed; timeout exceeded.

Same script runned from jupyter notebook takes 5 seconds and works. What could be the reason?

Thanks for your help
Alex


Matillion Agent  

Kalyan Arangam —

Hi Alejandro,

Its possible that the necessary ports are not open and the connection is timing out.
Please check the security group associated with the matillion ec2-instance has the necessary ports open.

Best
Kalyan

Post Your Community Answer

To add an answer please login