Don't click here unless you want to be banned.

LSL Wiki : llGetNextEmail

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl836.us.archive.org
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.

The queue seems to hold 101 emails. Any emails sent after that are bounced.

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
Comments [Hide comments/form]
Is the note about new keys for attachments after teleporting still true? I've been using a scripted attachment for several days now, and teleported many times, and it still seems to have the same key.
-- JeffCaldera (2006-01-11 21:42:45)
As of 19-FEB-06 (well that's when I noticed it) the body of any email sent into SL must be less than 1,000 characters. I got this (slight anonymised) email response when sending a longer message.

<mailtolsl@data.agni.lindenlab.com> (expanded from
< some key @lsl.secondlife.com>): Command died
with status 100: "/opt/linden/indra/tools/mailglue/mailglue --grid=agni
--system=lsl --rpcserver=http:xmlrpc.secondlife.com/cgi-bin/xmlrpc.cgi".
Command output: The body of your message must be less than 1000 characters.
-- EloisePasteur (2006-02-20 09:04:36)
As of 4-April-06 I am getting a wierd bug trying to FORWARD an email to an object in SL from GMail:

<mailtolsl@data.agni.lindenlab.com> (expanded from
<(valid UUID here)@lsl.secondlife.com>): Command died
with status 100: "/opt/linden/indra/tools/mailglue/mailglue --grid=agni
--system=lsl --rpcserver=http:
xmlrpc.secondlife.com/cgi-bin/xmlrpc.cgi".
Command output: Your email must be addressed to a UUID.

Of course the problem is that I AM using a valid UUID. I know because I tested it. There is something seriously *FUCKED UP* with their email system if it can't handle a forwarded email.
-- JarhynWilde (2006-04-04 15:40:11)
In addition to triggering all email events in the prim containing the script calling llGetNextEmail, I've been seeing the email event in the root prim is triggered as well for llGetNextEmail functions called in child prims. To test I've used the following scripts:

dummy email:

default
{
email(string time, string address, string subject, string message, integer num_remaining)
{
llOwnerSay("Prim " + (string)llGetLinkNumber() + " got e-mail even tho it didn't ask for one, I think I have " + (string)num_remaining + " left tho...");
}
}

email reciever:

integer NUM_MAILS = 2;

default
{
state_entry()
{
llSetTimerEvent(5);
llGetNextEmail(, );
}
timer()
{
llGetNextEmail(, );
}
email(string time, string address, string subject, string message, integer num_remaining)
{
llOwnerSay("I asked for this e-mail, and there are " + (string)num_remaining + " left for me to get!");
if (num_remaining)
llGetNextEmail(, );
}
}

email sender:

integer NUM_MAILS = 2;

default
{
state_entry()
{
integer i;
for (i = 0; i < NUM_MAILS; ++i)
llEmail((string)llGetKey() + "@lsl.secondlife.com", "test email " + (string)i, "testing one two three");
llRemoveInventory(llGetScriptName());
}
}

create a 3 prim object, put the dummy email script in all 3 prims, put the email sender in a child prim and wait for it to send and delete, then drop an email reciever script in that child prim. Sometimes you get prim 1 reporting e-mail events even when there's no emails waiting for it and even no email reciever scripts in it. This doesn't happen all the time and I'm trying to figure out if it's possible to make it repeatable, so far it happens to me until I make some large change either to the object (re-rez) or scripts it contains (add/delete).
-- DragonEccleston (2006-08-12 18:27:20)
I'm making a server, and how would I get the sender's key from the address? (or at all?)
-- DurnusScripter (2006-11-19 21:31:13)
The sender as in the owner of the object? You don't.
-- BlindWanderer (2006-11-20 06:43:24)
Attach a comment to this page: