Difference between revisions of "LlEmail"

From Second Life Wiki
Jump to navigation Jump to search
m (Added note for aditi addresses)
(Undo revision 86877 - not sure it works!)
Line 73: Line 73:
** Which means if the key returned by [[llGetKey]] is "a2e76fcd-9360-4f6d-a924-000000000003", then its email address is "a2e76fcd-9360-4f6d-a924-000000000003@lsl.secondlife.com".
** Which means if the key returned by [[llGetKey]] is "a2e76fcd-9360-4f6d-a924-000000000003", then its email address is "a2e76fcd-9360-4f6d-a924-000000000003@lsl.secondlife.com".
** Agents do not have fixed email addresses, use [[llInstantMessage]] or [[llOwnerSay]].
** Agents do not have fixed email addresses, use [[llInstantMessage]] or [[llOwnerSay]].
* If you are sending email to a prim on the Second Life Preview Grid (Aditi), its address is ''[key]''@lsl.aditi.lindenlab.com {{Jira|SVC-2873}}
|permission
|permission
|negative_index
|negative_index

Revision as of 21:47, 18 August 2008

Summary

Function: llEmail( string address, string subject, string message );

Sends an email to address with subject and message.

• string address
• string subject
• string message

The entire message (including the address, subject and other miscellaneous fields) can't be longer than 4096 bytes combined.

Specification

The message is prefixed with information about the prim sending the email.

Template Example
Object-Name: *prim*
Region: *simname* (*simpos.x*, *simpos.y*)
Local-Position: (*primpos.x*, *primpos.y*, *primpos.z*)

*message*
Object-Name: Object
Region: Gibson (254976, 256000)
Local-Position: (117, 129, 50)

The real message starts here.

Caveats

  • This function causes the script to sleep for 20.0 seconds.
  • There is a limit to the number of email messages an object can send in a given amount of time.
  • Due to the 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 function for reliable inter-region messaging.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> string email_address = "somebody@example.com"; // who will receive the messages

default {

   state_entry() {

       //Send an email to a normal email account
       llEmail( email_address, "Look it's an email subject line!", "Testing 1 2 3" );
   }

   touch_start( integer num_detected ) {
       integer i = 0;

       // Send another email, telling who touched the prim.
       do
           llEmail( email_address, "No touching!", "I was defiled by: " + llDetectedName(i) + "\nKey: " + (string) llDetectedKey(i) );
       while(++i < num_detected);
   }

}

</lsl>

Useful Snippets

<lsl> email( string time, string address, string subj, string message, integer num_left ) {

   if(llGetSubString(address, -19, -1) == "@lsl.secondlife.com")//trim the header
       message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);

} </lsl>

Notes

  • Because of the long delay on this function, it is often called from a second script triggered by link message.
  • If you are sending email to a prim within Second Life, its address is [key]@lsl.secondlife.com
    • Which means if the key returned by llGetKey is "a2e76fcd-9360-4f6d-a924-000000000003", then its email address is "a2e76fcd-9360-4f6d-a924-000000000003@lsl.secondlife.com".
    • Agents do not have fixed email addresses, use llInstantMessage or llOwnerSay.

See Also

Deep Notes

Search JIRA for related Issues

Tests

Signature

function void llEmail( string address, string subject, string message );

Open Source Portal

Feature Design Document

(none)

Functional Spec

(none)

Test scripts

internal test

Discussion for future improvements

(none)

Relationship to other features

List of features that need to be tested when this feature changes, and why.

IM to email - verify IM -> email still works.

Postcards - Postcards use email out?


User Guides

llEmail on LSLwiki.net