Changing Servers for Sending eMail

T

TimB

I need to send email from different mail servers depending on whether
I'm at home or work, what is the easiest way to do this with Entourage
2004?

Thanks!

-=Tim=-
 
J

Jeff Zienowicz

I need to send email from different mail servers depending on whether
I'm at home or work, what is the easiest way to do this with Entourage
2004?

I just installed this script that Barry Wainwright posted here some time
ago. It works great:



property homeServer : "mail.btinternet.com"
property workServer : "192.168.0.68"
property currentLocation : ""

if currentLocation is "Work" then
set defaultButton to 1
else
set defaultButton to 2
end if

set theLocation to button returned of (display dialog "Select a Location:"
buttons {"Home", "Work"} default button defaultButton)

tell application "Microsoft Entourage"

set theAccounts to every POP account & every IMAP account

if theLocation is "Work" then
repeat with anAccount in theAccounts
tell anAccount
if SMTP server is homeServer then
set SMTP server to workServer
set SMTP requires authentication to true -- May not be
required - depends on your setup
end if
end tell
end repeat
set currentLocation to "Work"
else
repeat with anAccount in theAccounts
tell anAccount
if SMTP server is workServer then
set SMTP server to homeServer
set SMTP requires authentication to false -- May not be
required - depends on your setup
end if
end tell
end repeat
set currentLocation to "Home"
end if
end tell
 
T

TimB

Diane and Jeff:

Thanks Diane, however I was hoping for something a little more "in
your face" as the user (it actually isn't me) is an extreme novice,
even more than me. :)

I just installed this script that Barry Wainwright posted here some time
ago. It works great:

property homeServer : "mail.btinternet.com"
property workServer : "192.168.0.68"
property currentLocation : ""

if currentLocation is "Work" then
set defaultButton to 1
else
set defaultButton to 2
end if

set theLocation to button returned of (display dialog "Select a Location:"
buttons {"Home", "Work"} default button defaultButton)

tell application "Microsoft Entourage"

set theAccounts to every POP account & every IMAP account

if theLocation is "Work" then
repeat with anAccount in theAccounts
tell anAccount
if SMTP server is homeServer then
set SMTP server to workServer
set SMTP requires authentication to true -- May not be
required - depends on your setup
end if
end tell
end repeat
set currentLocation to "Work"
else
repeat with anAccount in theAccounts
tell anAccount
if SMTP server is workServer then
set SMTP server to homeServer
set SMTP requires authentication to false -- May not be
required - depends on your setup
end if
end tell
end repeat
set currentLocation to "Home"
end if
end tell

Thanks Jeff.

I don't know a lot about scripts, the only other one I've used was
also in Entourage (deleting server email), will this popup a dialog?
Something like "home or work" would be optimal. Otherwise what is the
user experience?

Thanks so much!!!!

-=Tim=-
 
B

Barry Wainwright [MVP]

I just installed this script that Barry Wainwright posted here some time
ago. It works great:


Thanks for the good word Jeff,

It's worth mentioning that you should save the script as a compiled script &
put it in the ŒEntourage Script Menu Items¹ folder in your ŒMicrosoft User
Data¹ folder. The script can be manually run from the Script menu in
Entourage.
 
H

Hoi Nap at Swin

Hi Jeff,

I like your script, I have the following questions:

1, My case is a bit different. I want to send email with No.1 Account, but
I want to post thread to Newsgroup with No.1 Account. What shall I change
the script?

2, I think this is just the "design defect". When sending an email, we can
select any accounts from the list. But when you post a message, you have no
choice to select which account you want to use. It is strange, isn't it?

3, You can cc to an "email address" if you write a post; but you could not
cc to an "Newsgroup address" if you write an email. I think it is just
stupid. May I know is it true and it is my mistake?

4, How do you get your email like this "[email protected]" ???

Thanks!

Hoi Nap
 
J

Jeff Zienowicz

Thanks Diane, however I was hoping for something a little more "in
your face" as the user (it actually isn't me) is an extreme novice,
even more than me. :)

In addition to showing up in the Scripts menu, the script in my previous
post can easily have a key combination assigned to it, which makes it pretty
seamless.
I don't know a lot about scripts, the only other one I've used was
also in Entourage (deleting server email), will this popup a dialog?
Something like "home or work" would be optimal. Otherwise what is the
user experience?

The script -- and again thanks to Barry Wainwright for creating and sharing
it -- does pop up a dialog where you select "Work" or "Home;" it's very
simple and very fast. The button descriptions would be of course easy to
change by editing the script, even if you're not an AppleScript expert.

There is also a more elaborate script for changing SMTP servers that Paul
Berkowitz wrote. It's called "SMTP Location X;" you can find it at
macscripter.net. It's extremely flexible, but I believe it relies on
setting up an OS X "location" in the network preferences for each SMTP
server you want to use -- handy if other network settings need to be changed
at your various locations, but perhaps overkill if the only thing that needs
to be changed is the SMTP server.

Jeff
 
J

Jeff Zienowicz

I like your script, I have the following questions:

Barry Wainwright wrote the script; I just reposted it.
1, My case is a bit different. I want to send email with No.1 Account, but
I want to post thread to Newsgroup with No.1 Account. What shall I change
the script?

I assume you mean send mail with "No. 1" and post news with "No. 2."
2, I think this is just the "design defect". When sending an email, we can
select any accounts from the list. But when you post a message, you have no
choice to select which account you want to use. It is strange, isn't it?

You actually do -- see below.
3, You can cc to an "email address" if you write a post; but you could not
cc to an "Newsgroup address" if you write an email. I think it is just
stupid. May I know is it true and it is my mistake?

I've never needed to do this and therefore never tried, so I can't comment.
4, How do you get your email like this "[email protected]" ???

This is easy in Entourage. Just create a new POP account with the desired
email address you want to use on the newsgroup (your "INVALID" address). You
can put just an "x" in the SMTP server field and nothing at all in the
"Receiving Mail" section (you'll have to dismiss a dialog from Entourage
about the account being "send only").

Then, in your newsgroup account settings, choose the address you created as
the address to use for newsgroup postings ("Email account" in the "Personal
Information" section).

Jeff
 
T

TimB

Barry (and Jeff)

It's worth mentioning that you should save the script as a compiled script &
put it in the ŒEntourage Script Menu Items¹ folder in your ŒMicrosoft User
Data¹ folder. The script can be manually run from the Script menu in
Entourage.

This sounds great. Is there a resource you can point me to about
saving/compiling scripts?

Can this be made to run automatically every time Entourage is started?

Thanks again for all your help. :)

-=Tim=-
 
T

TimB

Selecting an account as default can't be more simple. Maybe I just don't get
you setup.

I was looking for something more "in your face" so he would be
prompted rather than have to remember.
 
J

Jeff Zienowicz

Can this be made to run automatically every time Entourage is started?

Forgot to mention that, yes, a script can run every time Entourage is
launched. Just create a schedule with the When set to "At Startup" and a
"Run AppleScript" action pointing to the script that changes SMTP servers.

Jeff
 
D

Diane Ross

I was looking for something more "in your face" so he would be
prompted rather than have to remember.

Did I miss this was a laptop? I was thinking two separate computers.

As Jeff mentioned, you can have a schedule launch an applescript at startup.
This should work under all circumstances.


--
Diane Ross, Microsoft Mac MVP
Entourage Help Page
<http://www.entourage.mvps.org/>
One of the top five MS Entourage resources listed on the Entourage Blog.
<http://blogs.msdn.com/entourage/>
 
T

TimB

Did I miss this was a laptop? I was thinking two separate computers.

I didn't explain it well. Sorry! :)

Anyone have suggestions for "Applescript for Dummies" resources? :)

-=Tim=-
 
A

Allen Watson

I didn't explain it well. Sorry! :)

Anyone have suggestions for "Applescript for Dummies" resources? :)

-=Tim=-
There's no such book, unfortunately. But there are a good dozen thorough
books about scripting. Basic Entourage info can be found on the Entourage
help website:

http://entourage.mvps.org/script/index.html

Books I can recommend:

AppleScript: A Comprehensive Guide...(Rosenthal)
AppleScript: The Missing Manual
AppleScript: The Definitive Reference

The first two do a fair job of introducing scripting to a novice; the latter
is a more thorough reference manual.

A new guide for scripting Office Apps will be available in April:

<http://mactech.com/news/?p=1009354>
 
T

TimB

There's no such book, unfortunately. But there are a good dozen thorough
books about scripting. Basic Entourage info can be found on the Entourage
help website:

http://entourage.mvps.org/script/index.html

Books I can recommend:

AppleScript: A Comprehensive Guide...(Rosenthal)
AppleScript: The Missing Manual
AppleScript: The Definitive Reference

The first two do a fair job of introducing scripting to a novice; the latter
is a more thorough reference manual.

A new guide for scripting Office Apps will be available in April:

<http://mactech.com/news/?p=1009354>
 
T

TimB

I'm a little late but I wanted to thank everyone for their help. I
finally got a chance to set it up today and the script works
beautifully. AppleScript couldn't be easier to adapt and adjust and
Entourage's Scheduling feature works like a charm.

As a lower-end moderate user I was able to setup my completely
technophobic friend with something of beauty. I can't even imagine
how I would be able to extend a Windows application with such ease.

Thanks to all!

-=Tim=-
 
Top