We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5c0f0d commit 8943b95Copy full SHA for 8943b95
1 file changed
Email script/Email Automation Script.py
@@ -0,0 +1,23 @@
1
+import smtplib
2
+from email.mime.text import MIMEText
3
+
4
+sender_email = 'your_email@example.com'
5
+receiver_email = 'recipient@example.com'
6
+smtp_server = 'smtp.example.com'
7
+smtp_port = 587
8
+smtp_username = 'your_email@example.com'
9
+smtp_password = 'your_email_password'
10
11
+message = MIMEText('Hello, this is an automated email!')
12
+message['Subject'] = 'Automated Email'
13
+message['From'] = sender_email
14
+message['To'] = receiver_email
15
16
+try:
17
+ with smtplib.SMTP(smtp_server, smtp_port) as server:
18
+ server.starttls()
19
+ server.login(smtp_username, smtp_password)
20
+ server.sendmail(sender_email, [receiver_email], message.as_string())
21
+ print("Email sent successfully!")
22
+except Exception as e:
23
+ print(f"Error sending email: {e}")
0 commit comments