The Email object allows you to send an email through an smtp server. Currently the body of the mail can only be in text format and not html.
email = program.newemail()
email.username = "email@example.com"
email.password = "password"
email.smtpserver = "smtp.gmail.com"
email.portserver = 587
email.enablessl = true
email.subject = "Mail Test"
email.body = "Hi! This a mail test"
email.sendfrom = "firstname.lastname@example.org"
email.sendto = "mailto"
value = email.send()
email.username = *value*
Set the smtp server login username
email.password = *value*
Set the smtp server login password
email.smtpserver = *value*
Set the name of the smtp server
email.portserver = *value*
Set the port number of the smtp server
email.enablessl = *bool*
Enable ssl protocol for shipping
Set the subject of the email
Set the text body of the mail
Set the email of the user sending the email
email.sendto = *value*
Set the email you will receive
*value* = email.username
In case the mail is not sent, it contains the error generated
Adds a document object as an attachment to the mail. The filename property is used to name the generated pdf
Adds a file as an attachment to the mail. The method is only usable from the Windows version
Add a copy email to recipients
Add an email to recipients in a hidden copy
Delete document objects from email
Delete files from the email
Delete recipients in a copy
Delete hidden recipients in copy
Send the email