#import os #import smtplib #from email import encoders #from email.mime.base import MIMEBase #from email.mime.multipart import MIMEMultipart #COMMSPACE = ', ' def sendgeotifs(attachments,email,fieldaddress,date,whitelabel, whitelabelEmail, whitelabelPassword): import os import smtplib from email import encoders from email.mime.text import MIMEText from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart #COMMASPACE = ', ' #if email.find('dbehr01@gmail.com')>=0: # email = 'ankuromar296@gmail.com' if whitelabelEmail is not None: sender = whitelabelEmail gmail_password = whitelabelPassword else: sender = 'support@farmonaut.com' gmail_password = 'ankur@A8' recipient = email outer = MIMEMultipart() year = date[0:4] month = date[4:6] day = date[6:] date = year+'-'+month+'-'+day+' (in yyyy-mm-dd)' outer['Subject'] = whitelabel+ ' | Satellite Results | Date: '+ date+' | Field Address: '+fieldaddress + ' Open on Android, iOS or Web-App' outer['To'] = recipient outer['From'] = sender message = 'Hello,'+ '\n\nThe new results for your field at the address: '+fieldaddress+' are available now. The Satellite crossed over your field on '+date+' . The results are best understood when directly accessed from our app. The next satellite movement is expected in the next 4-10 days. Please find attached below the GEOTIFF images of your field as well as a comprehensive report of all the results. These images can be used in third-party remote sensing/GIS softwares. Our system has processed images with the best standards. However, if some of the images do not satisfy your expectations, then revert back on this thread with the name of the images you want to be reviewed by us.\n\nPlatforms:\nAndroid: https://play.google.com/store/apps/details?id=com.farmonaut.android\niOS: https://apps.apple.com/us/app/farmonaut/id1489095847?ls=1\nWeb App: https://farmonaut.com/web-app\n\nRegards' whitelabel_url = "https://farmonaut.com/web-app" if "f4b-sat" in whitelabel: whitelabel_url = "https://f4b-sat.web.app" elif "troforte"in whitelabel: whitelabel_url = "https://app.trofortefarming.com.au" elif "linxag" in whitelabel: whitelabel_url == "https://linxag.web.app" else: outer.attach(MIMEText(message,"plain")) html_message = """