We have this python below as the last step in our batch processes to let us know when it is finisged. I am now trying to implement more information from PhotoScan in that email. I would like that the email could include the name of the actual project. I cant really figure out how to implement this.
import smtplib
import PhotoScan
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import socket
namn = socket.gethostname()
fromaddr = "*****@***.com"
toaddr = "****@***.***"
doc = PhotoScan.app.document
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = "Dator: " + socket.gethostname() + " - Photoscan Align Finished"
body = "Hej, " + socket.gethostname() + "is now finished with Align."
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(fromaddr, "**********")
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()