To configure and run the Email Tool script, perform the following steps to set up your email server credentials and define the parameters for sending emails.
1Open the Email_Tool tool connection.
2On the Code tab, uncomment the configuration block and enter the following property values:
- EMAIL_HOST
- EMAIL_PORT
- EMAIL_USERNAME
- EMAIL_PASSWORD
- EMAIL_USE_TLS
The following snippet shows a sample configuration block:
ENV_FILE = ".env"
#Set Emails credentials and comment it after first run #set_key(ENV_FILE, "EMAIL_HOST", 'smtp.gmail.com') #set_key(ENV_FILE, "EMAIL_PORT", '465') #set_key(ENV_FILE, "EMAIL_USERNAME", '') #set_key(ENV_FILE, "EMAIL_PASSWORD", '') #set_key(ENV_FILE, "EMAIL_USE_TLS", 'True')
After the initial run, you can remove these values.
Alternatively, you can manually add these values to your environment variables.
3On the Input Parameters tab, enter values for the following parameters to execute an SQL query:
Parameter
Description
From_Email
The sender's email address.
To_Email
One or more recipient email addresses, separated by a comma.
Subject
The subject line of the email.
Body
The plain text content of the email message.
HTML
The HTML-formatted content of the email message.
CC
Email addresses to be copied on the message (courtesy copy).
BCC
Email addresses to be included as blind courtesy copies.