*Email Server Credentials - Gmail* I am trying to...
# prefect-community
Email Server Credentials - Gmail I am trying to create Email Server Credentials Block I’ve created a Google App password [Blocks] -> [+] -> [Email Server Credentials] Added the App Password my email as a user name Smtp server : tried “emtp.gmail.com” and with none Smtp type: tried “465", “587” and none none of those work does someone have a working example? thanks
BTW, if I use the standard python package
with “emtp.gmail.com” and “587" it works fine
with the Prefect Block I get the following error
Copy code
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
I also tried setting to set the
Smtp Port
to “587”, this did not help as well
The code I am using is:
Copy code
from prefect_email import EmailServerCredentials, email_send_message
from prefect import flow

def example_email_send_message_flow():
    email_credentials_block = EmailServerCredentials.load("my_block_name")

    subject = email_send_message(
        subject="Example Flow Notification",
        msg="This proves email_send_message works!",
    return subject

The email block does not appear to be functioning. it looks like a simpler and a working solution is just to use python
Copy code
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart