I'm using a while True loop with a gmail API code I found online to extract some data if it's found inside of an email.
It all works for the most part though i've run into an issue. The gmail section will always look for a new email with this code - which I want!
The issue is, I have function that requires a stored variable from the while true loop named 'email' below will be a rough example:
[login to view URL](temp_dict)
a = temp_dict['Snippet']
b = temp_dict['Sender']
c = temp_dict['Subject']
idk = 'test'
if c in idk:
z = [login to view URL](':')
complete_string = z + ':' + z
test = z
test1 = z
x = [login to view URL]("<")
y = [login to view URL](">")
email = (b[x:y]).strip('<')
print'No new messages!'
me = "xxxxxxxxxxxxx@[login to view URL]"
my_password = r"xxxxxxxxxxxxx"
you = email < ----- This section here needs to be passed down from the while True loop.
msg = MIMEMultipart('alternative')
msg['Subject'] = "xxxxxxxxxxx"
msg['From'] = me
msg['To'] = you
html = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
part2 = MIMEText(html, 'html')
[login to view URL](part2)
s = smtplib.SMTP_SSL('[login to view URL]')
[login to view URL](me, my_password)
[login to view URL](me, you, msg.as_string())
[login to view URL]()
9 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön
Hello! I am a python developer. I looked at your project and it seems interesting. I have all necessary skills required for this project. Ping me to discuss in detail.