email

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 = "help@nios4.dev"

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 = "help@nios4.dev"

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

email.subject= *value*
Set the subject of the email

email.body= *value*
Set the text body of the mail

email.sendfrom= *value*
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

email.adddocument(*document*,*filename*)

Adds a document object as an attachment to the mail. The filename property is used to name the generated pdf

email.addfile(*path*)

Adds a file as an attachment to the mail. The method is only usable from the Windows version

email.addcc( *value*)

Add a copy email to recipients

email.addbcc( *value*)

Add an email to recipients in a hidden copy

email.cleardocument( )

Delete document objects from email

email.clearfile( )

Delete files from the email

email.clearcc( )

Delete recipients in a copy

email.clearbcc( )

Delete hidden recipients in copy

email.send( )

Send the email