Using SMTP on a Function App API

Ho, Keith D 120 Reputation points
2024-11-07T21:17:43.2433333+00:00

When I run the code below through that's on my API call, the code stops at the smtp_connection part. I'm able to run the API locally but when it is deployed on the Function App, it doesn't run through the smtp_connection line. Are there any settings I need to set up to allow this to go through?

        smtp_server = os.getenv("SMTP_SERVER")  
        smtp_port = 25  
        smtp_connection = smtplib.SMTP(smtp_server, smtp_port)  
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,096 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.