The Email component allows us to send and receive emails without user interaction.
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 );
}
Methods
The following methods are available on the Email object:
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”
Object: {
from,
to,
cc,
subject,
body }
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.