Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

milaph

macrumors newbie
Original poster
Dec 5, 2006
2
0
I'm just learning AppleScript and I'm running into a really stupid problem.

I can open a new message in Mail and get the text of the message to work and everything, but I can't seem to figure out how to get the message to send. Can someone enlighten me? I know this is probably really simple...

Thanks in advance.
 

Fearless Leader

macrumors 68020
Mar 21, 2006
2,360
0
Hoosiertown
Code:
tell application "Mail" 
    set theMessages to the selection
    repeat with thisMessage in theMessages
        display dialog "30 Boxes subject:" default answer (thisMessage's subject as string)
        set theSubject to text returned of result
        set newMessage to make new outgoing message
        tell newMessage
            set subject to theSubject
            set content to thisMessage's content
            make new to recipient with properties {address:"add@30boxes.com"}
        end tell
        send newMessage
        delete newMessage
    end repeat
end tell

I pulled this from a site. Im not entirely sure what your script looks like, but look at send newMessage
 

Unorthodox

macrumors 65816
Mar 3, 2006
1,087
1
Not at the beach...
Code:
tell application "Mail" 
        activate
        set newMessage to make new outgoing message
        tell newMessage
            set subject to "[I][B]subject goes here[/B][/I]"
            set content to "[I][B]message subject goes here[/B][/I]"
            make new to recipient with properties {address:"[I][B]recipients_email_address@whatever.com[/B][/I]"}
        end tell
        send newMessage
end tell
Just replace the bold text with the proper info.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.