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__)
|
pfad = os.path.dirname(__file__)
|
||||||
|
|
||||||
def Nachricht(fradress, toadress, bccs, sub, attach):
|
def Nachricht(fradress, toadress, bccs, sub,body, attach):
|
||||||
fromaddr = fradress
|
fromaddr = fradress
|
||||||
toaddr = toadress
|
toaddr = toadress
|
||||||
|
|
||||||
|
fobj = open(pfad + "/mpg/pass.txt") #Passwort für den Gmailaccount laden
|
||||||
|
|
||||||
fobj = open(pfad + "/mpg/pass.txt")
|
|
||||||
passw = []
|
passw = []
|
||||||
for line in fobj:
|
for line in fobj:
|
||||||
a = line.rstrip()
|
a = line.rstrip()
|
||||||
passw.append(a)
|
passw.append(a)
|
||||||
fobj.close()
|
fobj.close()
|
||||||
|
|
||||||
pwd = passw[0]
|
pwd = passw[0]
|
||||||
|
|
||||||
msg = MIMEMultipart()
|
msg = MIMEMultipart()
|
||||||
|
|
@ -28,8 +25,6 @@ def Nachricht(fradress, toadress, bccs, sub, attach):
|
||||||
msg['To'] = toaddr
|
msg['To'] = toaddr
|
||||||
msg['Subject'] = sub
|
msg['Subject'] = sub
|
||||||
|
|
||||||
body = 'Hello World again and again and again'
|
|
||||||
|
|
||||||
msg.attach(MIMEText(body, 'plain'))
|
msg.attach(MIMEText(body, 'plain'))
|
||||||
|
|
||||||
for each in attach:
|
for each in attach:
|
||||||
|
|
@ -53,16 +48,17 @@ def Nachricht(fradress, toadress, bccs, sub, attach):
|
||||||
server.quit()
|
server.quit()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
fobj = open(pfad + "/mpg/adressen.txt")
|
||||||
fradress='carsten.richter77@gmail.com'
|
fradress='carsten.richter77@gmail.com'
|
||||||
toadress='carsten.richter77@gmail.com'
|
toadress='carsten.richter77@gmail.com'
|
||||||
sub='das ist der finale Standalonetest'
|
sub='das ist der finale Standalonetest'
|
||||||
anhang = ['adressen.txt','heute.pdf']
|
anhang = ['adressen.txt','heute.pdf']
|
||||||
|
body = 'lalaland_Teil2'
|
||||||
fobj = open(pfad + "/mpg/adressen.txt")
|
|
||||||
bcc = []
|
bcc = []
|
||||||
for line in fobj:
|
for line in fobj:
|
||||||
a = line.rstrip()
|
a = line.rstrip()
|
||||||
bcc.append(a)
|
bcc.append(a)
|
||||||
fobj.close()
|
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