Back

CreateEmail

Hello World
Content:
- Methods

The Email component allows us to send and receive emails without user interaction.

eml = app.CreateEmail( account, password ) → app object: Email

Example - Example

function OnStart()
{
    email = app.CreateEmail( "mymail@gmail.com", "MyPass" );
    email.SetSMTP( "smtp.gmail.com", 465 );
    email.SetOnStatus( email_OnStatus );


    app.ShowProgress( "Sending..." );
    email.Send( "My Subjewct", "My Content", "mymail@yahoo.com", "myothermail@gmail.com" );
}

function email_OnStatus( status )
{
    app.HideProgress();
    app.ShowPopup( status );
}
    Copy     Copy All       Run      

Methods

The following methods are available on the Email object:

GetType() → string: “Email”
string
number: integer
number: integer: 993 or 995
number: integer: 465 or 578 or 587
string: path to file or folder ( “/absolute/...” or “relative/...” )
string: “email”
string: “password”
string: “email address”
string: “imap/pop.gmail.com or “imap/pop.mail.yahoo.com or “imap/pop.gmx.net
string: smtp.gmail.com, smtp.mail.yahoo.com, mail.gmx.net
object: { from, to, cc, subject, body }
function( data )
function( status )
eml.GetType
Returns the control class name.
eml.Receive
Start receiving emails from a given folder.
eml.Send
Send an email to someone.
eml.SetIMAP
Set IMAP or POP3 settings for receiving messages.
eml.SetOnMessage
Define a callback function which is called when a message is received.
eml.SetOnStatus
Define a callback function which is called when a status changed.
eml.SetSMTP
Set SMTP settings for sending messages.