llTargetedEmail
function
Function syntax
llTargetedEmail(integer target,// Target constant (e.g.,TARGETED_EMAIL_OBJECT_OWNERorTARGETED_EMAIL_ROOT_CREATOR). Values: EmailTargetstring subject,// Subject of the email.string msg// Email message body.
);- Delay
- 20 s
- Energy
- 10
Sends an email to the owner (selected by target) of an object with subject and message.
The entire message (including the address, subject and other miscellaneous fields) can’t be longer than 4096 bytes combined.
llTargetedEmail(0, "", "");Specification
Section titled “Specification”The target parameter selects which agent the email is sent to
| Constant | Val | Select the email destination |
|---|---|---|
TARGETED_EMAIL_OBJECT_OWNER | 2 | send email to the owner of the current object |
The message is prefixed with information about the prim sending the email.
| Template | Example |
|---|---|
| |
Caveats
Section titled “Caveats”- Originally this function was intended to enable sending email to either the object owner or creator; however, the ability to email creators was removed to avoid abuse scenarios.
- There is a limit to the number of email messages an object can send in a given amount of time.
- There is a limit of 500 messages from a single agent’s objects in a one hour period.
- The 4096 byte size limit includes the subject line and automatically added text. The practical maximum body size is approximately 3600 bytes.
- (Sept-2008) The Email Throttle was modified slightly, Per Prospero Linden’s comments: “there has long been a throttle that makes a single script sleep for 20 seconds after sending an email. The new throttle is per user… some were using many, many different scripts to send spam. (the new throttle applies) when the destination is outside of Second Life. I know that messages within the same region were not throttled (beyond the 20-second delay), and I *believe* that messages between different sims were not throttled (between the 20-second delay).”
- 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.
- Due to the bug SVC-391
llEmailwill silently fail (no mail will arrive) when non-ascii characters are present in the subject. However, non-ascii characters in the message body will be replaced by ”?”.
Examples
Section titled “Examples”Example 1
9 collapsed lines
string emailSubject = "Someone touched me!";
default{ touch_start(integer num_detected) { // llSay(PUBLIC_CHANNEL, "Sending eMail report now, this will take ~20 seconds.");
key id = llDetectedKey(0); string name = llDetectedName(0);
llTargetedEmail(TARGETED_EMAIL_OBJECT_OWNER, emailSubject, "I was touched by: '" + name + "' (" + (string)id + ").");
// llSay(PUBLIC_CHANNEL, "Email has been sent."); }}See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.