Saturday, January 3, 2009

Basic E-mail in Second Life

To send and get replies to E-mail thru Second Life, use this script in your prim.
////////////////////////////////////////////
//Type inside the quotes here:

string eMail ="arth.karas@gmail.com";//your email address, but remove the spare @
string subject = "E-mail test"; //subject in quotes
string bodyText = "This what I wrote."; //text in quotes


//Now save script

default
{

state_entry()
{
llOwnerSay("Sending email now"); //Tell owner you are sending the e-mail
llSetObjectName(llKey2Name(llGetOwner())); //from the Owner...
llEmail(eMail, subject, bodyText); //send the email..
llSetTimerEvent(5); //start watching for a reply ...
}

timer()
{
llGetNextEmail("", ""); //if an email is there,
}

email(string time, string address, string subj, string message, integer num_left)
{
llOwnerSay("Email from "+address+". Subject: "+ subj + ":\n" + message);//Read it to owner
}
}

////////////////////////////////////////////////////
I got an e-mail

~Arth Karas <89c5765b-04a7-06a5-84f8-79cbff0bfbf8@lsl.secondlife.com>
~to arth.karas@gmail.com
~date Sun, Jan 4, 2009 at 12:16 AM
~subject E-mail test
~
~Object-Name: Arth Karas
~Region: SLVEC (230400, 229888)
~Local-Position: (178, 143, 21)
~
~This is what I wrote.

~~~~Sending demystified.~~~~~~
Getting e-mail into SL is a bit harder:

Click reply, BUT
~remove the object name and from the e-mail
~so the address was: 89c5765b-04a7-06a5-84f8-79cbff0bfbf8@lsl.secondlife.com

~remove all links, and formatting in the email - even breaks!
~ NOW send it.

and in my chat:
Arth Karas: I got an email from arth.karas@gmail.com. Subject: Re: E-mail test:
This what I wrote.