Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
autoprospect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Samy Haffoudhi
autoprospect
Commits
02d2dedd
Commit
02d2dedd
authored
Feb 05, 2022
by
Samy Haffoudhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration google sheets
parent
ad080b5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
autoprospect.py
autoprospect.py
+4
-0
sheets.py
sheets.py
+11
-0
No files found.
autoprospect.py
View file @
02d2dedd
import
os
import
os
import
smtplib
import
smtplib
from
email.message
import
EmailMessage
from
email.message
import
EmailMessage
from
sheets
import
get_mails
EMAIL_ADDRESS
=
os
.
environ
.
get
(
'EMAIL_USER'
)
EMAIL_ADDRESS
=
os
.
environ
.
get
(
'EMAIL_USER'
)
EMAIL_PASSWORD
=
os
.
environ
.
get
(
'EMAIL_PASS'
)
EMAIL_PASSWORD
=
os
.
environ
.
get
(
'EMAIL_PASS'
)
...
@@ -11,6 +12,9 @@ msg['From'] = EMAIL_ADDRESS
...
@@ -11,6 +12,9 @@ msg['From'] = EMAIL_ADDRESS
msg
[
'To'
]
=
'haffoudhisamy@gmail.com'
msg
[
'To'
]
=
'haffoudhisamy@gmail.com'
msg
.
set_content
(
'test content'
)
msg
.
set_content
(
'test content'
)
adresses
=
get_mails
()
print
(
adresses
)
with
smtplib
.
SMTP_SSL
(
'smtp.gmail.com'
,
465
)
as
smtp
:
with
smtplib
.
SMTP_SSL
(
'smtp.gmail.com'
,
465
)
as
smtp
:
smtp
.
login
(
EMAIL_ADDRESS
,
EMAIL_PASSWORD
)
smtp
.
login
(
EMAIL_ADDRESS
,
EMAIL_PASSWORD
)
...
...
sheets.py
0 → 100644
View file @
02d2dedd
import
gspread
from
oauth2client.service_account
import
ServiceAccountCredentials
scope
=
[
"https://spreadsheets.google.com/feeds"
,
'https://www.googleapis.com/auth/spreadsheets'
,
"https://www.googleapis.com/auth/drive.file"
,
"https://www.googleapis.com/auth/drive"
]
creds
=
ServiceAccountCredentials
.
from_json_keyfile_name
(
"creds.json"
,
scope
)
client
=
gspread
.
authorize
(
creds
)
sheet
=
client
.
open
(
"test autoprospect"
)
.
sheet1
def
get_mails
():
adresses
=
sheet
.
col_values
(
3
)
return
adresses
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment