Spaces:
Runtime error
Runtime error
Amirizaniani
commited on
Commit
•
71a3375
1
Parent(s):
0743796
Update app.py
Browse files
app.py
CHANGED
@@ -169,7 +169,7 @@ def process_inputs(llm, file, relevance, diversity, email):
|
|
169 |
|
170 |
# Check network connectivity to the custom port
|
171 |
try:
|
172 |
-
socket.create_connection(("your.relay.server",
|
173 |
except OSError:
|
174 |
return "Network is unreachable. Unable to send email."
|
175 |
|
@@ -194,7 +194,7 @@ def process_inputs(llm, file, relevance, diversity, email):
|
|
194 |
message.attach(part)
|
195 |
|
196 |
try:
|
197 |
-
with smtplib.SMTP('your.relay.server',
|
198 |
server.starttls() # Upgrade the connection to a secure encrypted SSL/TLS connection
|
199 |
server.login(sender_email, sender_password)
|
200 |
server.sendmail(sender_email, receiver_email, message.as_string())
|
|
|
169 |
|
170 |
# Check network connectivity to the custom port
|
171 |
try:
|
172 |
+
socket.create_connection(("your.relay.server", 8080), timeout=10) # Replace with your relay server and port
|
173 |
except OSError:
|
174 |
return "Network is unreachable. Unable to send email."
|
175 |
|
|
|
194 |
message.attach(part)
|
195 |
|
196 |
try:
|
197 |
+
with smtplib.SMTP('your.relay.server', 8080) as server: # Use your relay server and custom port
|
198 |
server.starttls() # Upgrade the connection to a secure encrypted SSL/TLS connection
|
199 |
server.login(sender_email, sender_password)
|
200 |
server.sendmail(sender_email, receiver_email, message.as_string())
|