send edited image to email
This commit is contained in:
parent
6e6a4c014f
commit
6d080ca45d
7
main.py
7
main.py
@ -32,7 +32,7 @@ def send_email():
|
|||||||
|
|
||||||
# message variable
|
# message variable
|
||||||
subject = "confirm your account"
|
subject = "confirm your account"
|
||||||
msg = "your OTP code is"
|
msg = "Here's your email confirmation"
|
||||||
|
|
||||||
zmail = MIMEMultipart()
|
zmail = MIMEMultipart()
|
||||||
zmail['From'] = mail_sender
|
zmail['From'] = mail_sender
|
||||||
@ -43,7 +43,8 @@ def send_email():
|
|||||||
zmail.attach(MIMEText(msg, 'plain'))
|
zmail.attach(MIMEText(msg, 'plain'))
|
||||||
|
|
||||||
# attach picure
|
# attach picure
|
||||||
pict = open('images/main/black-suit.png', 'rb').read();
|
add_textimg("Your otp code is " + str(randis))
|
||||||
|
pict = open("images/output/pos.png", "rb").read()
|
||||||
zmail.attach(MIMEImage(pict, name="black man suit"))
|
zmail.attach(MIMEImage(pict, name="black man suit"))
|
||||||
|
|
||||||
# creating context
|
# creating context
|
||||||
@ -56,4 +57,4 @@ def send_email():
|
|||||||
print("Failed to send a email")
|
print("Failed to send a email")
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
add_textimg("Your otp code is 3826")
|
send_email()
|
Loading…
x
Reference in New Issue
Block a user