-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule_3_2.py
20 lines (16 loc) · 1.23 KB
/
module_3_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def send_email(message, recipient, *, sender='[email protected]'):
if ('@' not in recipient or '@' not in sender) or (not recipient.endswith(('.com', '.ru', '.net'))
and not sender.endswith(('.com', '.ru', '.net'))):
print(f'Impossible to send email from address: {sender} to address: {recipient}')
return
if recipient == sender:
print('Impossible to send email to yourself!')
return
if sender == '[email protected]':
print(f'The email is sent from address: {sender} to address: {recipient} successfully!')
else:
print(f'NOT STANDARD SENDER! The email is sent from address: {sender} to address: {recipient}')
send_email('Это сообщение для проверки связи', '[email protected]')
send_email('Вы видите это сообщение как лучший студент курса!', '[email protected]', sender='[email protected]')
send_email('Пожалуйста, исправьте задание', '[email protected]', sender='[email protected]')
send_email('Напоминаю самому себе о вебинаре', '[email protected]', sender='[email protected]')