llGetNextEmail(string address, string subject)
This function requests the next waiting email with sender
address and
subject. You can leave these empty to match any address and/or subject in the
queue.
If a matching email is found in the queue,
llGetNextEmail will remove it from the queue and trigger an
email() event in one to three seconds. If no matching email is found, this function has no effect. This function will trigger the
email() event in all scripts in the prim.
- Not sure where the 1-3 second statistic comes from, but after sending and checking 1000 emails using llResetTime() before every llGetNextEmail() then llGetTime() in the email() event the longest delay observed was 0.379707s and the average time was 0.216751s. That was under heavy email load, emails recieved a bit less frequently can take less than 0.05s to retrieve. -DragonEccleston
The queue seems to hold 101 emails. Any emails sent after that are bounced.
- As of SL 1.6.6, the number of pending emails is 100 and bounce messages are received when a queue is full. -Splat1Edison
- The max value returned by num_left in the email() event is 100, plus the email just received is 101. -DragonEccleston
The address for sending email to an
object is
<objectkey>@lsl.secondlife.com. So for example, an object which returned "
9dd0db80-d7f0-cf7d-699d-5afb6eed0640" on a call to
llGetKey would be reachable as
9dd0db80-d7f0-cf7d-699d-5afb6eed0640@lsl.secondlife.com.
This will allow you to receive email from within a script from the outside world. Works by checking a global list of pending incoming emails, and returning the next matching one if there are any. This mail spool persists across script resets.
llGetNextEmail differs from
llListen in that it must be called every time you want to check your mail, you can't just set it and have incoming emails trigger the
email() event. If you want to check for email at regular intervals, use a
timer.
Note: When you teleport, your
attachments are derezzed and re-rezzed at the new location. This means that they will all receive new keys (see
llGetKey) and that emailing scripts in attachments is therefore a bit tricky.
This is no longer true; I don't know when it changed. Detaching and re-attaching does, however, result in a new key. -
SiannBeck
To
send an email, use
llEmail.
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Communications