BugFixing
This commit is contained in:
parent
66a736e30e
commit
82748083bd
1 changed files with 6 additions and 10 deletions
16
send_Mail.py
16
send_Mail.py
|
|
@ -7,19 +7,16 @@ import os
|
|||
|
||||
pfad = os.path.dirname(__file__)
|
||||
|
||||
def Nachricht(fradress, toadress, bccs, sub, attach):
|
||||
def Nachricht(fradress, toadress, bccs, sub,body, attach):
|
||||
fromaddr = fradress
|
||||
toaddr = toadress
|
||||
|
||||
|
||||
|
||||
fobj = open(pfad + "/mpg/pass.txt")
|
||||
fobj = open(pfad + "/mpg/pass.txt") #Passwort für den Gmailaccount laden
|
||||
passw = []
|
||||
for line in fobj:
|
||||
a = line.rstrip()
|
||||
passw.append(a)
|
||||
fobj.close()
|
||||
|
||||
pwd = passw[0]
|
||||
|
||||
msg = MIMEMultipart()
|
||||
|
|
@ -28,8 +25,6 @@ def Nachricht(fradress, toadress, bccs, sub, attach):
|
|||
msg['To'] = toaddr
|
||||
msg['Subject'] = sub
|
||||
|
||||
body = 'Hello World again and again and again'
|
||||
|
||||
msg.attach(MIMEText(body, 'plain'))
|
||||
|
||||
for each in attach:
|
||||
|
|
@ -53,16 +48,17 @@ def Nachricht(fradress, toadress, bccs, sub, attach):
|
|||
server.quit()
|
||||
return
|
||||
|
||||
|
||||
fobj = open(pfad + "/mpg/adressen.txt")
|
||||
fradress='carsten.richter77@gmail.com'
|
||||
toadress='carsten.richter77@gmail.com'
|
||||
sub='das ist der finale Standalonetest'
|
||||
anhang = ['adressen.txt','heute.pdf']
|
||||
|
||||
fobj = open(pfad + "/mpg/adressen.txt")
|
||||
body = 'lalaland_Teil2'
|
||||
bcc = []
|
||||
for line in fobj:
|
||||
a = line.rstrip()
|
||||
bcc.append(a)
|
||||
fobj.close()
|
||||
|
||||
Nachricht (fradress,toadress,bcc,sub,anhang)
|
||||
Nachricht (fradress,toadress,bcc,sub,body,anhang)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue