-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule_3_2_2.py
23 lines (19 loc) · 1.25 KB
/
module_3_2_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def send_email(message, recipient, sender="[email protected]"):
if ("@" not in recipient or "@" not in sender or
(".com" not in recipient and ".net" not in recipient and ".ru" not in recipient) or
(".com" not in sender and ".net" not in sender and ".ru" not in sender)):
print(f"It is impossible to send a letter from the address {sender} to the address {recipient} .")
else:
if sender == recipient:
print("“ You can’t send a letter to yourself! ”")
elif sender == "[email protected]":
print(f"The letter was successfully sent from the address {sender} to the address {recipient} .")
else:
print(f"NON-STANDARD SENDER! The letter was sent from the address {sender} to the address {recipient} .")
send_email('This is a communication check message', '[email protected]')
send_email('You see this message as the best student of the course!', '[email protected]',
sender='[email protected]')
send_email('Please correct the assignment', '[email protected]',
sender='[email protected]')
send_email('Reminding myself about the webinar', '[email protected]',
sender='[email protected]')