Applescript that sends mail.. (urgent)?

sims sims at ezpzapps.com
Thu Feb 21 13:56:00 EST 2002


--OUTLOOK EXPRESS

tell application "Finder"

	--**** **** **** ****
	--Type your message between the following inverted commas. ¬
	--Remember to leave a line between the first inverted commas¬
	--and the start of your message  **** **** ****

	set myVar3 to ¬
		"
Your message goes in here
Your message goes in here
Your message goes in here
Your message goes in here
Your message goes in here

Yours faithfully

FirstName Surname"

	set myVar1 to "Dear "




	repeat

		tell application "Finder"
			activate
			with timeout of 300 seconds
				display dialog "Include a person's 
first name?" buttons {"Yes", "No", "Quit"}
			end timeout

			if button returned of result = "Yes" then

				display dialog "Type in the first 
name" default answer ""
				set myVar2 to (text returned of 
result as text) & "
				  "
				set myVar4 to myVar1 & myVar2 & myVar3

			else if button returned of result = "No" then
				set myVar4 to myVar3


				--When there's no-one's first name
			else if button returned of result = "Quit" then
				exit repeat
			end if




			with timeout of 180 seconds
				display dialog "Type in email 
address" default answer "" buttons {"Quit", "OK"} default button "OK"
			end timeout
			set DialogResult to result
			set myVar to text returned of DialogResult as 
text --sets myVar to email address you type in
			set myButton to button returned of DialogResult
			if myButton = "Quit" then
				exit repeat
			end if
			if myButton = "OK" then
				set myVar to text returned of 
DialogResult as text
			end if





			-- **** **** **** ****
			-- ****Next is a bit of script that, apart 
from other things,  puts
			-- your subject in the subject field. Type in 
your subject ¬
			-- between the inverted commas after the word 
'subject' ¬
			-- below inside the curly brackets****

			tell application "Outlook Express"
				activate
				make new draft window with properties ¬
					{subject:"Your subject goes 
in here", content:myVar4, to recipients:myVar} ¬

			end tell





		end tell

	end repeat




end tell

------------------------


--FOR AOL  (heavily commented...but you said 'urgent')


set tAttach to ¬
	alias "Macintosh HD:Desktop Folder:AllSimsAllTheTime:130202sims.sit"
--(choose file with prompt "Select file")


tell application "America Online"

	--set toList to {"AOLUser"}

	--set ccList to {"name1 at example.com", "name2 at example.com"}

	--set bccList to {}

	--set mailSubject to "Widgets"

	--set mailMessage to "Dear AOLUser:" & return & return & 
"Hope you're having fun." & return & return & "Love, AppleScript 
Editor"

	--set att to alias "SYS:test file"

	set documentRef to make new document with properties {kind:mail}

	--set mailref to mailer of documentRef

	--set text of documentRef to mailMessage

	--set subject of mailer of documentRef to mailSubject

	--repeat with mailRecipient in toList

	--make new addressee at end of mailref with properties 
{kind:regular, name:mailRecipient}

	--end repeat

	--repeat with mailRecipient in ccList

	--make new addressee at end of mailref with properties 
{kind:cc, name:mailRecipient}

	--end repeat

	--repeat with mailRecipient in bccList

	--make new addressee at end of mailref with properties 
{kind:bcc, name:mailRecipient}

	--end repeat

	--make new attachment at end of docref with properties {local file:att}

	make new attachment at end of documentRef with properties 
{local file:tAttach}

	-- SendLetter documentRef

	--close documentRef saving no
end tell





>Sorry if this is a bit offtopic, but I need an Applescript that sends an
>e-mail using Outlook Express (or other common, preferably free mailprogram
>on Mac). Anyone knows how to do it? It's for an article and the deadline
>is just about now..
>thanks,
>/Niklas Almesj–

___________________________________________

    http://www.EZPZapps.com         info at EZPZapps.com
       Software - Internet Development - Consulting



More information about the use-livecode mailing list