new msg in Entourage with new ReplyTo/From Email

Wondering if it is possible to create a message with applescript
set theMsg…
and include a reply Email address that isn’t in the standard Entourage Account.

I was able to do this easily for Eudora using “from”.
Can’t seem to find the solution anywhere for Entourage!
Would like to find if for Mail as well.

Hope the solution is going to be easy…
Want to do it within FileMaker.
:smiley:

Here is the basic format to create a new message in Entourage. I don’t know of a way to specify a different “From” name. The only thing I found in the library is a “sender” property but I couldn’t get it to work. Maybe you can experiment with that.

tell application "Microsoft Entourage"
	activate
	set theMsg to make new draft window with properties {subject:"Subject Here", content:"Body copy here", recipient:{"name@address.com"}}
end tell

Hi Matt-Boy

Thanks for you reaction.
I tried a few things with sender, but couldn’t get it to work. I believe it is specifically for mails that are within Entourage.
To address the sender field of a recieved mail.

Still despirately seeking…

I did get it to work with Mail useing:
set sender to “from@me.nl”

Still struggling with Entourage

Can’t seem to change the Priority settings with Mail.app either!
Any ideas with that?
With Entourage priority:high works easy.

Hi,

the dictionary of Entourage says, that the property sender is a record with lables address and display name
Try:

set sender to {address:"from@me.nl", display name:"me"}

Sure wish it was that easy.
Entourage still uses the account info.

Any other solutions are welcome…

I’m not an Entourage expert, but maybe this works

tell application "Microsoft Entourage"
	set newMessage to make new outgoing message with properties {subject:"test"}
	set account of newMessage to POP account 1
end tell

Hello Stefan,

Thanks for the reply. But your solution does not tackle my problem.
After a few days struggling all found out that it is actually not possible.
Something that is so easily done for Mail.app and Eudora. It is can’t be done easy in Entourage.

Still managed to find a workaround solution besides manually creating a Reply-To header in the Accout settings of Entourage.

For some reason the script only works when you have the new mail window open.

tell application "Microsoft Entourage"
	set theWindow to window 1
	if {class of theWindow} is not in {draft window, draft news window} then
		beep
		display dialog "The script only works with a new message window in front." buttons {"OK"} default button 1 with icon 0
		return
	end if
	
	save theWindow
	set theMsg to displayed message of theWindow
	close theWindow saving yes
	set sender of theMsg to {address:"demo@rakesh.nl", display name:"George Whatsis"}
	send theMsg
end tell

Resource: http://www.mail-archive.com/entourage-talk@lists.letterrip.com/msg04082.html

So you were actually right Stafan with

Except that the window needs to be open. :smiley:

Now back to my other problem off Mail.app Priority settings…

Hm, very strange,
this works on my machine (G5 Dual, Office 2004) without opening any window:

tell application "Microsoft Entourage"
	tell (make new outgoing message with properties {to recipients:"John@doe.com", subject:"Hello"})
		set sender to {{address:"[EMAIL PROTECTED]", display name:"me"}}
		send
	end tell
end tell

Note: if you include the sender in the properties, it doesn’t work (this behavior happens often)

AFAIK this is not possible with normal AppleScript commands , maybe with GUI scripting

The Account Email (reply to) is indeed being changed. Also without the window open.
Except it contains jibberish. Chinese characters and all.
Do you also have this? Perhaps { instead of {{?
But then it doesn’t work?

With set theMsg to…
the sender to {… doesn’t work.
Interesting to see it does work with tell…

Using Entourage 11.3.3 here.

:lol: yes, I’m sorry, I just copied your line into my script to hide my account data.
Of course only one pair of braces is correct.


...
 set sender to {address:"[EMAIL PROTECTED]", display name:"me"}
...

Little correction on my last post…
It just needed “of theMsg” if i wish to use it with the “set theMsg to make…”:
set sender of theMsg to {address:“[EMAIL PROTECTED]”, display name:“me”}
to have it do the same as with the tell (make new…

And again they both don’t work for me.
It simply doesn’t use the email given.
There comes a text saying (send by …) after “me” but no Email there at all.
How does it work for you?

So I’m still with the open message solution for now.

Really hope to hear more…

These three forms use different ways to reference the objects but do exactly the same

tell application "Microsoft Entourage"
	tell (make new outgoing message with properties {to recipients:"John@doe.com", subject:"Hello"})
		set sender to {address:"[EMAIL PROTECTED]", display name:"me"}
		send
	end tell
end tell
tell application "Microsoft Entourage"
	set newMsg to make new outgoing message with properties {to recipients:"John@doe.com", subject:"Hello"}
	tell newMsg
		set sender to {address:"[EMAIL PROTECTED]", display name:"me"}
		send
	end tell
end tell
tell application "Microsoft Entourage"
	set newMsg to make new outgoing message with properties {to recipients:"John@doe.com", subject:"Hello"}
	set sender of newMsg to {address:"[EMAIL PROTECTED]", display name:"me"}
	send newMsg
end tell

Here is an example to choose the sender account from a list (for this example it takes only the POP accounts)
and works as it should on my machine:

tell application "Microsoft Entourage"
	set {mailList, nameList} to {email address, full name} of POP accounts
	set myAccount to choose from list mailList with prompt "choose account"
	if myAccount is false then return
	set myAccount to item 1 of myAccount
	-- set myName to full name of (get 1st POP account whose email address is myAccount) this doesn't work :(
	repeat with i from 1 to count mailList
		if item i of mailList is myAccount then
			set myName to item i of nameList
			exit repeat
		end if
	end repeat
	tell (make new outgoing message with properties {to recipients:"John@doe.com", subject:"Hello"})
		set sender to {address:myAccount, display name:myName}
		send
	end tell
end tell

This makes it clear for me :slight_smile:

Thanks a lot for your time & effort!