The object allows sending an email. Emails are sent through an SMTP server. Currently the body of the email can only be plain text, not HTML.
| Availability | The object is returned by a method or a property of another object |
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"
result = email.send()
addbcc
| Description | Allows you to add a recipient in bcc to the email |
| Value Type | |
| Format | email.addbcc(mail) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| mail | string | The email address to add |
Examples
email.addbcc("info@d-one.info")
addcc
| Description | Allows you to add a cc recipient to the email |
| Value Type | |
| Format | email.addcc(mail) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| mail | string | The email address to add |
Examples
email.addcc("info@d-one.info")
adddocument
| Description | Allows you to add a document object as an attachment to the email. The attachment will be in PDF format |
| Value Type | |
| Format | email.adddocument(document, namefile) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| document | document | The object that contains the print to be sent |
| namefile | string | The name of the file that will be used to save the document in pdf format |
Examples
email.adddocument(printer_order,"order.pdf")
addfile
| Description | Allows you to add a file as an attachment to the email |
| Value Type | |
| Format | email.addfile(path) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| path | string | The full path name where to retrieve the file to be attached |
Examples
email.addfile("c:/documents/drawing.dwg")
body
| Description | Sets the body of the email |
| Value Type | string |
| Format | string = email.body |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
bodydocument
| Description | Uses a print created from a document object saved in html format as the body of the email |
| Value Type | string |
| Format | string = email.bodydocument |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
clearcc
| Description | Deletes all the emails inserted as cc |
| Value Type | |
| Format | email.clearcc() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
email.clearcc()
cleardocument
| Description | Deletes all document objects inserted as attachments in the email |
| Value Type | |
| Format | email.cleardocument() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
email.cleardocument()
clearfile
| Description | Deletes all files attached to the email as attachments |
| Value Type | |
| Format | email.clearfile() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
email.clearfile()
enablessl
| Description | Enables or disables the use of SSL channel for sending emails |
| Value Type | boolean |
| Format | boolean = email.enablessl |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
messageerror
| Description | Returns the possible error in case of failed email delivery |
| Value Type | string |
| Format | string = email.messageerror |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
password
| Description | Sets the password for the email account to be used for sending |
| Value Type | string |
| Format | string = email.password |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
portserver
| Description | Sets the port of the mailbox to use for sending |
| Value Type | integer |
| Format | integer = email.portserver |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
send
| Description | Proceeds with sending the emails |
| Value Type | boolean |
| Format | boolean = email.send() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
bool = email.send()
sendfrom
| Description | Sets the sender email address |
| Value Type | string |
| Format | string = email.sendfrom |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
sendto
| Description | Sets the recipient’s email address |
| Value Type | string |
| Format | string = email.sendto |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
smtpserver
| Description | Sets the smtp server address used for sending the email |
| Value Type | string |
| Format | string = email.smtpserver |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
subject
| Description | Sets the subject of the email |
| Value Type | string |
| Format | string = email.subject |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |
username
| Description | Sets the user of the sending mailbox |
| Value Type | string |
| Format | string = email.username |
| Type | Property |
| Systems | Windows, Web, Android, IOS, Mac OS |