Back

CreateEmail

Hello World
Content:
- Methods

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

mail = 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: { COMMAND }
Object: { from, to, cc, subject, body }
function( data )
function( status )
mail.Batch
Batch method calls to be able to set all object's properties at once.
Note that you need to specify each parameter (use “” or null to leave some out)
Inherited methods can be called by appending an underscore to the function name (ie. txt.Batch({ SetBackColor_: [“red”] })
mail.GetType
Returns the control class name.
mail.Receive
Start receiving emails from a given folder.
mail.Send
Send an email to someone.
mail.SetIMAP
Set IMAP or POP3 settings for receiving messages.
mail.SetOnMessage
Define a callback function which is called when a message is received.
mail.SetOnStatus
Define a callback function which is called when a status changed.
mail.SetSMTP
Set SMTP settings for sending messages.