|
|
|
Send E-mail using Buddy API
Added on 12/3/2002
|
|
Compatibilities:
Required Xtras:
Buddy API
|
This item has not yet been rated
|
-- Instead of using another xtra, you can send E-mail using Buddy API (which is free when using two functions)
-- The difference between command -GoToNetPage "mailto:name@name.com"- and sending e-mail with Buddy API is that the second one does not open browser window.
Download PC Source
property pSp
property pTo
property pSubject
property pBody
property myTo, myFrom, MySubject, myBody
on getPropertyDescriptionList
set d = [:]
addProp d, #pTo, [#default: "0", #format: #field,#comment: "To:"]
addProp d, #pSubject, [#default: 0, #format: #field , #comment: "Subject"]
addProp d, #pBody, [#default: 0, #format: #field, #comment: "Body Text:"]
return d
end
on beginSprite me --
myTo =pTo.text
--
MySubject = pSubject.text
end
on mouseUp me
myBody = urlEncode(pBody.text)
-- Buddy Api command
baOpenUrl("mailTo:"&myTo &"?subject=" &MySubject &"&body=" &myBody, "normal" )
end
--Converts Text to URL Coded Data
on urlEncode whichString
if NOT stringP(whichString) then exit
set reservedListASCII = [32, 123, 125, 124, 92, 94, 126, 91, 93, 39,35, 37, 60, 62, 34, 59, 44, 47, 63, 58, 64, 61, 38, 13]
set replaceList = ["%20", "%7B", "%7D", "%7C", "%5C", "%5E", "%7E", "%5B", "%5D", "%27", "%23", "%25", "%3C", "%3E", "%22", "%3B", "%2C", "%2F", "%3F", "%3A", "%40", "%3D", "%26","%0D"]
set sLength = the number of chars in whichString
repeat with i = 1 to sLength
set currentChar = charToNum(char i of whichString)
set replaceLoc = getOne(reservedListASCII,currentChar)
if replaceLoc then
put getAt(replaceList,replaceLoc) into char i of whichString
set i = i + 2
set sLength = sLength + 2
end if
end repeat
return whichString
end
on getBehaviorDescription
set description = "Sen E-mail using BuddyApi"
return description
end
|
|