我正在嘗試使用 Python 自動化我的冷電子郵件銷售流程。我基本上想把一堆信息放到一個谷歌表中。Google 表格中的列值為姓名、電子郵件、公司、跟進、新聞項目。來自以下值的跟進(試圖找出一種跟蹤跟進數(shù)量的方法):是,#1,#2,否我能夠從 Google 表格中讀取數(shù)據(jù),并且能夠發(fā)送電子郵件。這是谷歌表`。這是我的代碼:import csvimport smtplibimport gspreadimport pandas as pdimport pprintfrom oauth2client.service_account import ServiceAccountCredentialsfrom emailsettings import USERNAME, PASSWORDfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartscope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)client = gspread.authorize(creds)sheets = client.open('Example').sheet1sh = client.open_by_url('https://docs.google.com/spreadsheets/d/1RkzEkCJ4kEbdsW4-LqyO8bKTKBm9XlXrMp49UxIpotQ/edit#gid=0')sheet = sh.get_worksheet(0)data1 = sheet.get_all_values()smtp = smtplib.SMTP('smtp.gmail.com',port=587,timeout=10)smtp.starttls()smtp.login(USERNAME,PASSWORD)INITIAL_MESSAGE = """Hi {},I came across your name while looking for contacts at {}. Huge fan of your work. I'm a person and I'm the founder and COO of this company. This Company is a full-service internet marketing agency, specializing in social media advertising. We've worked with Fortune 500 Company and many others. I'm reaching out because we've helped several companies with increasing their ROI and wanted to see if you were open to discussing your digital goals for 2019. Would you be open to hop on a quick call? Here's my schedule for the week. Looking forward to hearing from you. Thanks, Name它打印出“公司”并給我這個錯誤:NameError: name 'subject' is not defined我的目標是用有關電子郵件、個人、公司和新聞項目的信息填充電子表格。填寫電子表格并運行腳本后,它將跟蹤跟進次數(shù)并根據(jù)多個可用模板生成電子郵件。我聽說通過創(chuàng)建類、方法和屬性會更容易,但不確定如何做到這一點。
添加回答
舉報
0/150
提交
取消