I've struck a problem where Mail cannot load a Logo image into a mail message.
The following is one of many permutations I've tried from Shane's book, but Mail does not respond.
Any thoughts please?
Regards
Santa
on eMailit(the_subject, the_content, theCCRecipients)
try
set logoPath to MailManagerDesktopFolderPath & ":Logo.png"
set logoPath to (POSIX path of logoPath) as POSIX file
# set logoPath to logoPath as POSIX file
on error errmsg
display dialog errmsg
set LogoPath to ""
end try
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {visible:true, subject:the_subject, content:the_content}
tell content of newMessage
try
set y to count of the_content
set color of characters 1 thru y to textcolor
end try
set x to offset of TheBusinessName in the_content
set font of characters x thru (x + (count of TheBusinessName) - 1) to "Helvetica Bold"
set color of characters x thru (x + (count of TheBusinessName) - 1) to {56342, 2442, 607}
repeat with x from 1 to (count of the_content)
if character x of the_content = "●" then
set color of character x to {56342, 2442, 607}
end if
end repeat
end tell
tell newMessage
try
make new attachment with properties {file name:logoPath} at before the first paragraph
on error errmsg
display dialog errmsg
end try
set TempList to my readfile1(" Main Mail Recipient.dat")
repeat with themailitem in TempList
make new to recipient at end of to recipients with properties {address:themailitem}
end repeat
try
set TempList to my readfile1(theCCRecipients)
repeat with themailitem in TempList
make new cc recipient at end of cc recipients with properties {address:themailitem}
end repeat
end try
end tell
tell newMessage
send
delay 1
try
close saving no
end try
end tell
end tell
end eMailit