Spaces:
Running
Running
Commit
·
16e4359
1
Parent(s):
fa00338
Update app.py
Browse files
app.py
CHANGED
@@ -162,20 +162,20 @@ def send_brevomail(email,msg,stdate):
|
|
162 |
}
|
163 |
|
164 |
try:
|
165 |
-
|
166 |
if response.status_code == 200:
|
167 |
st.success("Email sent successfully!")
|
168 |
#print(response.text)
|
169 |
else:
|
170 |
st.error(f"Error {response.status_code}: {response.text}")
|
171 |
except requests.exceptions.HTTPError as errh:
|
172 |
-
|
173 |
except requests.exceptions.ConnectionError as errc:
|
174 |
-
|
175 |
except requests.exceptions.Timeout as errt:
|
176 |
-
|
177 |
except requests.exceptions.RequestException as err:
|
178 |
-
|
179 |
|
180 |
def main():
|
181 |
|
|
|
162 |
}
|
163 |
|
164 |
try:
|
165 |
+
response = requests.post(url, headers=headers, data=json.dumps(data))
|
166 |
if response.status_code == 200:
|
167 |
st.success("Email sent successfully!")
|
168 |
#print(response.text)
|
169 |
else:
|
170 |
st.error(f"Error {response.status_code}: {response.text}")
|
171 |
except requests.exceptions.HTTPError as errh:
|
172 |
+
st.error(f"HTTP Error: {errh}")
|
173 |
except requests.exceptions.ConnectionError as errc:
|
174 |
+
st.error(f"Error Connecting: {errc}")
|
175 |
except requests.exceptions.Timeout as errt:
|
176 |
+
st.error(f"Timeout Error: {errt}")
|
177 |
except requests.exceptions.RequestException as err:
|
178 |
+
st.error(f"An unexpected error occurred: {err}")
|
179 |
|
180 |
def main():
|
181 |
|