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

LSL Wiki : email

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl427.us.archive.org
email(string time, string address, string subj, string message, integer num_left)

Triggered when a request by llGetNextEmail is answered. Returned are the email's time, sender's address, subject in subj, the message itself and how many more emails are queued for this object in num_left.

time is a UNIX timestamp (integer) typecast as a string, similar to that returned by llGetUNIXTime.

address and subj are limited to 78 characters each.
message is limited to 1000 characters. (4KByte, not 1000 byte)

The message field is formatted as follows:
Object-Name: object_name\n
Region: region_name (region_corner _coordinates)\n
Local-Position: (local_pos)\n
\n
message_text

Where:
object_name is the name of the sending object. To get the objects key, look at the sender's address.
region_name is the name of sim the object is located in. This is as returned by llGetRegionName.
region_corner_coordinates is the region's Region Corner. This is in the format x,y with no z component. t is not enclosed in <>'s.
local_pos is the sending object's local position. It is in the format x,y,z . It is not enclosed in <>'s.
message_text is the actual text sent in the message string in llEmail.

To remove the headers attached to the beginning of the message, use this line:
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);

Notes:

Example:
default {
    state_entry() {
        llEmail((string)llGetKey() + "@lsl.secondlife.com", "Test!", "This is a test message."); // Send email to self.
        
        llSetTimerEvent(2.5); // Poll for emails. (Yes, that is a retarded way on an event-based system!)
    }
    
    timer() {
        llGetNextEmail("", ""); // Check for email with any sender address and subject.
    }
    
    email(string time, string address, string subj, string message, integer num_left) {
        llSay(0, "You got mail! " + (string)num_left + " more mails.");
        llSay(0, llList2CSV([time, address, subj, message]));
        if (num_left == 0) llSetTimerEvent(0.0); // Stop timer when there's no more email.
    }
}

To send an email, use llEmail.


Events | Communications
Comments [Hide comments/form]
I've encountered a problem with incoming messages with lines which contain two equal signs "==". Any line which contains this string is stripped as well as any lines below it. This is troubling because Base64 encoded strings which have spare bytes at the end are padded with equal signs. If you are left with one spare byte, your Base64 string *will* end with two equal signs, thus the entire line will be stripped as well as any subsequent lines in the message!
-- UsherCaldera (2004-10-07 12:00:43)
Please note change to 1,000 character limit on inbound messages.
<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:17:10)
Closing italics.
-- CatherineOmega (2006-02-21 23:36:55)
Has anyone found out a way to fetch each seperate line of the email body?
-- HeusDens (2007-08-26 20:22:09)
Attach a comment to this page: