Spaces:
Sleeping
Sleeping
Commit
·
fa00338
1
Parent(s):
0e7be9f
Update app.py
Browse files
app.py
CHANGED
@@ -163,18 +163,18 @@ def send_brevomail(email,msg,stdate):
|
|
163 |
|
164 |
try:
|
165 |
response = requests.post(url, headers=headers, data=json.dumps(data))
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
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():
|
|
|
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():
|