Repository navigation
Expand file tree
/
Copy pathpython_gmail.py
More file actions
301 lines (266 loc) · 10.7 KB
/
Copy pathpython_gmail.py
File metadata and controls
301 lines (266 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from dotenv import load_dotenv
import os
load_dotenv()
SENDER_EMAIL = os.getenv("MY_EMAIL")
SENDER_PASSWORD = os.getenv("APP_PASSWORD")
RECIPIENTS = [
"kunihirajoshua270@gmail.com",
"admin@maranathahealth.org",
"programsdirector@maranathahealth.org",
"managingdirector@maranathahealth.org"
]
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
message = MIMEMultipart("alternative")
message["Subject"] = "Website Proposal for Maranatha Health Uganda"
message["From"] = SENDER_EMAIL
#Email Template
def create_email_template():
html = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maranatha Health Website Proposal</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #443232;
padding: 20px 0;
}
.wrapper { background-color: #443232; }
.container {
max-width: 600px;
margin: 0 auto;
background: linear-gradient(135deg, #443232 0%, #352525 100%);
border-radius: 0px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(255, 251, 251, 0.059);
border: 1px solid rgba(254, 254, 255, 0.2);
}
/* Header Section */
.header {
background: linear-gradient(135deg, #a39a9a 0%, #a39a9a 100%);
padding: 40px 30px;
text-align: center;
color: white;
border-bottom: 0px solid #5b21b6;
}
.header h1 {
font-size: 28px;
font-weight: 700;
margin-bottom: 10px;
letter-spacing: 0.5px;
}
.header p {
font-size: 14px;
opacity: 0.95;
font-weight: 300;
}
/* Main Content */
.content {
padding: 40px 30px;
color: #e5e7eb;
}
.greeting {
font-size: 16px;
margin-bottom: 25px;
line-height: 1.6;
}
.greeting strong {
color: #faf5f5;
font-weight: 600;
}
/* Portfolio Section */
.portfolio {
background: rgba(48, 31, 2, 0.1);
border-left: 4px solid #cbbfbf;
padding: 20px;
border-radius: 6px;
margin: 25px 0;
}
.portfolio-links {
display: flex;
flex-direction: column;
gap: 8px;
}
.portfolio-link {
color: #fafafa;
text-decoration: none;
font-size: 14px;
padding: 8px 12px;
background: rgba(124, 58, 237, 0.15);
border-radius: 4px;
transition: all 0.3s ease;
display: block;
}
.portfolio-link:hover {
background: rgba(124, 58, 237, 0.25);
color: #7c3aed;
}
/* Contact Info */
.contact-info {
background: rgba(124, 58, 237, 0.05);
padding: 20px;
border-radius: 6px;
margin: 25px 0;
font-size: 13px;
color: #d1d5db;
}
.contact-info p {
margin: 8px 0;
}
.contact-label {
color: #ffffff;
font-weight: 600;
}
/* Footer */
.footer {
background: rgba(0, 0, 0, 0.3);
padding: 30px 30px;
text-align: center;
border-top: 1px solid rgba(124, 58, 237, 0.2);
}
.footer-text {
color: #9ca3af;
font-size: 13px;
margin-bottom: 15px;
line-height: 1.5;
}
/* Social Links */
.social-links {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 15px;
}
.social-link {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
background: rgba(124, 58, 237, 0.2);
border: 1px solid rgba(124, 58, 237, 0.3);
border-radius: 50%;
color: #7c3aed;
text-decoration: none;
font-weight: bold;
font-size: 14px;
transition: all 0.3s ease;
}
.social-link:hover {
background: #7c3aed;
color: white;
border-color: #7c3aed;
}
/* Location Badge */
.location-badge {
display: inline-block;
background: #fafafc;
color: rgb(88, 61, 61);
padding: 8px 16px;
border-radius: 4px;
font-size: 13px;
font-weight: 600;
margin-top: 15px;
}
/* Divider */
.divider {
height: 1px;
background: rgba(124, 58, 237, 0.2);
margin: 20px 0;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container">
<!-- Header -->
<div class="header">
<h1>Joshua</h1>
<p>Web Developer & Data Scientist</p>
</div>
<!-- Main Content -->
<div class="content">
<p class="greeting">
Hi <strong>Maranatha Health Management Team</strong>, 👋
</p>
<p style="color: #d1d5db; font-size: 14px; line-height: 1.7; margin-bottom: 20px;">
I hope you are good and healthy. I'm Joshua, a freelance web developer & Data Scientist,I specialize in designing and developing professional websites for businesses, organizations, and individuals.</p>
<p style="color: #d1d5db; font-size: 14px; line-height: 1.7; margin-bottom: 20px;">
I would like to propose the development of a modern, responsive, and user-friendly website tailored specifically to your business and its goals. The website would provide a professional online presence where potential customers can learn about your services, explore your products, contact you, and easily connect with your business.
</p>
<p style="color: #d1d5db; font-size: 14px; line-height: 1.7; margin-bottom: 20px;">
The proposed website can include key features such as service/product pages, contact and inquiry forms, social media integration, Google Maps/location information, an image gallery, and other functionality relevant to your business.
</p>
<p style="color: #d1d5db; font-size: 14px; line-height: 1.7; margin-bottom: 20px;">
Attached on this email is the proposal document that outlines the project scope, timeline, and estimated costs. I would be happy to discuss this proposal further and answer any questions you may have.
</p>
<!-- Portfolio Section -->
<div class="portfolio">
<div class="portfolio-links">
<a href="https://docs.google.com/document/d/1yMY-9QwvCZUUMg_RcUpZ5zKfJltPxhFF/edit?usp=drive_link&ouid=105325251502316070595&rtpof=true&sd=true" class="portfolio-link">→ Proposal Document</a>
<a href="https://abookijoshua.com" class="portfolio-link">→ Featured Web Development Projects/Clents</a>
</div>
</div>
<!-- Contact Information -->
<div class="contact-info">
<p><span class="contact-label">Email:</span> kunihirajoshua270@gmail.com</p>
<p><span class="contact-label">Phone:</span> +256-703-621-254</p>
<p><span class="contact-label">Location:</span> Kampala, Uganda</p>
</div>
</div>
<!-- Footer -->
<div class="footer">
<p class="footer-text">
Let's connect! I'd love to hear about your project and explore how we can work together to bring your vision to life.
</p>
<div class="social-links">
<table cellpadding="0" cellspacing="0" border="0" style="display: inline-block;">
<tr>
<!-- LinkedIn -->
<td style="padding-right: 10px;">
<a href="https://www.linkedin.com/in/kunihira-joshua/" target="_blank" style="text-decoration: none;">
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/linkedin/linkedin-original.svg" alt="LinkedIn" width="20" height="20" style="display: block; border: none;">
</a>
</td>
<!-- GitHub -->
<td style="padding-right: 10px;">
<a href="https://github.com/200-4" target="_blank" style="text-decoration: none;">
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/github/github-original.svg" alt="GitHub" width="20" height="20" style="display: block; border: none;">
</a>
</td>
<!-- Portfolio -->
</tr>
</table>
</div>
<div class="location-badge">
✓ Based in Kampala, Uganda
</div>
<p class="footer-text" style="margin-top: 20px; font-size: 11px; opacity: 0.7;">
© 2026 Joshua | Web Developer & Data Scientist<br>
Available for freelance projects | Open to collaboration
</p>
</div>
</div>
</div>
</body>
</html>
"""
return html
html = create_email_template()
message.attach(MIMEText(html,"html"))
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
server.login(SENDER_EMAIL,SENDER_PASSWORD)
for recipient in RECIPIENTS:
message["To"] = recipient
server.sendmail(SENDER_EMAIL, recipient, message.as_string())
del message["To"]
print(f"Email sent to {len(RECIPIENTS)} recipient(s)!")