Difference between revisions of "Email"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 2: Line 2:
|event_id=21|event_delay
|event_id=21|event_delay
|event=email
|event=email
|p1_type=string|p1_name=time|p1_desc
|p1_type=string|p1_name=time|p1_desc=In the <code>(string)[[llGetUnixTime]]</code> format
|p2_type=string|p2_name=address|p2_desc
|p2_type=string|p2_name=address|p2_desc
|p3_type=string|p3_name=subj|p3_desc|
|p3_type=string|p3_name=subject|p3_desc|
p4_type=string|p4_name=message|p4_desc
p4_type=string|p4_name=message|p4_desc
|p5_type=integer|p5_name=num_left|p5_desc
|p5_type=integer|p5_name=num_left|p5_desc=The number of emails left in the email queue
|event_desc=Triggered when task receives email
|event_desc=Triggered when task receives email
|constants
|constants
|spec
|spec
|caveats=*'''time''' is in the (string)[[llGetUnixTime]] format.
|caveats=
*The email queue is limited to 100 emails, any email after that is bounced.
*The email queue is limited to 100 emails, any email after that is bounced.
* Due to bug {{Jira|SVC-23}} (present since 2005), objects may stop receiving emails completely until either the region is restarted or the object crosses a region boundary (resetting the script doesn't help).  Emails sent may eventually be received after a restart/region-cross.  Hence, don't rely on this event for reliable inter-region messaging.  
* Due to bug {{Jira|SVC-23}} (present since 2005), objects may stop receiving emails completely until either the region is restarted or the object crosses a region boundary (resetting the script doesn't help).  Emails sent may eventually be received after a restart/region-cross.  Hence, don't rely on this event for reliable inter-region messaging.  

Revision as of 21:35, 24 June 2008

Description

Event: email( string <span title="In the (string)llGetUnixTime format" style="border-bottom:1px dotted; cursor:help;">time, string address, string subject, string message, integer num_left ){ ; }

Triggered when task receives email

• string time In the (string)llGetUnixTime format
• string address
• string subject
• string message
• integer num_left The number of emails left in the email queue

Caveats

  • The email queue is limited to 100 emails, any email after that is bounced.
  • Due to bug SVC-23 (present since 2005), objects may stop receiving emails completely until either the region is restarted or the object crosses a region boundary (resetting the script doesn't help). Emails sent may eventually be received after a restart/region-cross. Hence, don't rely on this event for reliable inter-region messaging.


Examples

This application uses email to have objects check with a central server to see if the owner has the latest version. In the objects: <lsl> string version = "1"; // string type = "lolcube"; default {

   on_rez(integer start_param)
   {
       llEmail("5a634b27-f032-283f-2df2-55ead7724b23@lsl.secondlife.com",
           version,
           (string)llGetOwner()+","+type);
   }

}</lsl> The server: <lsl> default {

   state_entry()
   {
       llSetTimerEvent(15);
   }
   
   timer()
   {
       llGetNextEmail("","");
   }
   
   email( string time, string address, string version, string message, integer num_left )
   {    
       if ((integer)version < 2)
       {
           list info = llCSV2List(llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1));
           llGiveInventory(llList2Key(info,0),llList2String(info,1));
       }
       
       integer i;
       for (i = 0; i < num_left; i++)
       {
           llGetNextEmail("","");
       }
   }

} </lsl>

See Also

Functions

•  llEmail
•  llGetNextEmail

Deep Notes

Signature

event void email( string time, string address, string subject, string message, integer num_left );