Triggered as a result of calling llGetNextEmail where there is a matching email in the email queue.
email( string time, string address, string subject, string message, integer num_left )
Event ID: 21.
(string)llGetUnixTime formatThe email queue is associated with the prim and any script in the prim can access it.
The prim's email address is its key with "@lsl.secondlife.com" appended, llGetKey() + "@lsl.secondlife.com"[2].
The email event is triggered as a result of calling llGetNextEmail when there is an email that matches llGetNextEmail's optional filters. The first email that matches the filters is removed from the email queue and its data is used as the parameters for this event. If no email matches the filters but the queue is not empty this event is not triggered. Besides the effects of filtering, the email queue is FIFO.
default
{
state_entry()
{
llSetTimerEvent(5.0);
}
timer()
{
// get next email, don't filter by sender or subject
llGetNextEmail("", "");
}
email( string time, string address, string subject, string message, integer num_left )
{
// if we received an email from an object within Second Life
if (llGetSubString(address, -19, -1) == "@lsl.secondlife.com")
// {
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);
// }
// PUBLIC_CHANNEL has the integer value 0
llSay(PUBLIC_CHANNEL, message);
// if there's another email in the queue waiting
// get next email, don't filter by sender or subject
if(num_left)
llGetNextEmail("", "");
}
}
For tips on how to process emails sent from within SL, see the entry on llEmail.
llGetKey() + "@lsl." + grid + ".lindenlab.com"; for the main beta grid set grid to "aditi".