Simple email

I need a script that when run, will send an email that says:
“backup completed” with today’s date.
It would use Mail program on OSX 10.4.1
Any help is appreciated.
dzelnio

Try this:

set mess_age to ((current date) & return & return & "Backup Completed") as string
tell application "Mail"
	set b to make new outgoing message
	tell b to make new to recipient
	set sender of b to "EMAIL@ADDRESS.HERE" --This needs to be a valid email address from (one of) your Mail Account(s)
	set subject of b to "Backup Message"
	set content of b to mess_age
	set address of first to recipient of b to "EMAIL@OF.RECIPIENT"
	send b
end tell

Good Luck,

I got an AppleScript Error:
Mail got an error. Can’t get to recipient 1 of outgoing message id 470721744. Invalid index.
Do I need to set up Mail somehow?

That to receipient isn’t being made…

Try something like this:

set theMessage to ((current date) & return & return & "Backup Completed") as string

tell application "Mail"
	tell (make new outgoing message)
		--This needs to be a valid email address from (one of) your Mail Account(s)
		set sender to "EMAIL@ADDRESS.HERE"
		set subject to "Backup Message"
		set content to theMessage
		make new to recipient with properties {address:"EMAIL@OF.RECIPIENT"}
		send
	end tell
end tell

Hi,

I use this simple subroutine


set theAddress to "janedoe@example.com"
set theName to "Jane Doe"
set theSubject to "Backup Message"
set theContent to ((current date) & return & return & "Backup Completed") as string

new_Mail(theSubject, theContent, theName, theAddress)

on new_Mail(theSubject, theContent, theName, theAddress)
	tell application "Mail"
		set newMessage to make new outgoing message with properties {visible:true, subject:theSubject}
		tell newMessage
			set content to theContent
			make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
			send
		end tell
	end tell
end new_Mail