LATEST VERSION 1.2 (29.11.2014)


UMail is an UObject created to send and receive emails. With this module you will be able to send and receive emails to many recipients, add and save attachments, etc. This module is based on POCO library and utilizes Secure Sockets Layer (SSL) connection. UMail was tested with a Gmail account.

The POCO C++ Libraries are a collection of open source C++ class libraries that simplify and accelerate the development of network-centric, portable applications in C++. The libraries integrate perfectly with the C++ Standard Library and fill many of the functional gaps left open by it. Their modular and efficient design and implementation makes the POCO C++ Libraries extremely well suited for embedded development, an area where the C++ programming language is becoming increasingly popular, due to its suitability for both low-level (device I/O, interrupt handlers, etc.) and high-level object-oriented development.  


UMail was compiled with all the shared libraries (all included in package). Copy them to the uobjects folder or set path in system environment variable (PATH). 

  • libiconv.dll
  • PocoCrypto.dll
  • PocoFoundation.dll
  • PocoNet.dll
  • PocoNetSSL.dll
  • PocoUtil.dll
  • PocoXML.dll
  • libssl32.dll
  • ssleay32.dll

You can also use a static linking option. In this case you need to download POCO, OpenSSL, libconv libraries and add in preprocessor definitions (USING_STATIC_LIBICONV, POCO_STATIC). You can download all the precompiled projects here (POCOlibconvlibtidy).

See UMail in action

Module functions

Main functions"smtp_address", smtp_port, "pop3_address", pop3_port, "login", "password", "encoding"); - set up a mail client, you can set the encoding for your mails (content, subject, sender name, file names, etc.), default encoding is UTF-8.
bool = UMail.SaveAttachments(ID,"path/to/save/"); - save attachments of email with the specified ID, returns false if any problem occurs (check console information).

Sending functions

UMail.sendFrom("I Robot"); - set sender name,
UMail.sendTo(["address1","address2",...]);  - set recipent list,
UMail.sendCc(["address3","address4",...]);  - set carbon copy recipent list,
UMail.sendBcc(["address5","address6",...]); - set blind carbon copy recipent list,
UMail.sendSubject("text"); - set subject,
UMail.sendContent("text"); - set content (you can use html tags),
UMail.sendAttachment(["file1","file2",...]);  - add attachments (set path and name of attached file),
bool = UMail.Send(); - send message, returns false if any problem occurs (check console information).

Receiving functions

bool = Umail.Check(); - check for new email (this function will download only headers, server will be informing you about new emails), 
UMail.receiveNew; - the number of new emails waiting for download 
bool = UMail.Receive(); - download all emails, (if there are no new emails, all receive lists stay unchanged), returns false if any problem occurs (check console information),
senderID = UMail.receiveFrom[ID]; - get sender name of email with the specified ID,
["recipient1 recipient2,..."] = UMail.receiveTo[ID]; - get main recipient list of email with the specified ID,
["recipient1 recipient2,..."] = UMail.receiveCc[ID]; - get carbon copy recipient list of email with the specified ID,
subjectID = UMail.receiveSubject[ID]; - get subject of email with the specified ID,
dateID = UMail.receiveDate[ID]; - get date of email with the specified ID,
textID = UMail.receiveContent[ID]; - get content of email with the specified ID, if the content is multipart format it first,
["attachment1, attachment2,..."] =UMail.receiveAttachment[ID]; - get attachment list separated by ',' of email with the specified ID,

Urbiscript examples

Example 1

var Global.mail="",587,"",995,"example[at]";,"12345","utf-8");
mail.sendFrom("I Robot");
mail.sendSubject("Hi! It's me");
mail.sendContent("I am a funny robot!<br> Please check my attachment.<br><br><b><i>I Robot</b></i>");

Example 2

var number_of_new_emails = mail.receiveNew;

Example 3







EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 1.0, 04.04.2018

FLASH Documentation