Change outgoing mail server using macro (VBA)

R

Robert Leitner

I use my laptop at the office and at home. At the office, our ISP requires
us to use their SMTP server for sending email. At home, my ISP requires me
to use their SMTP server for sending email. Everytime I change environments
(almost on a daily basis), I have to manually change the SMTP servers by
going to "Tools->Email Accounts...".

Is there a way to programatically change the outgoing mail server? I would
love to write two macros to change the outgoing mail servers to the desired
values at the click of a button, but I don't see how to access this
information through VBA.

Does anyone know how to do this?

P.S. - I am using Outlook 2002.
 
M

Michael Bauer

Hi Robert,

why don´t you use two profiles with the same *.pst and different mail
accounts?
 
R

Robert Leitner

Hmmm... hadn't thought about that. In most cases I would say that would be a
good solution to the problem, but let me add some additional information
specific to my situation that I believe makes the proposed solution "less
than ideal".

When I leave the office for the day and pack-up my laptop, I almost always
just hibernate (I probably only shutdown/reboot once every few weeks). I do
this because I am usually in the middle of a things, with lots of emails open.

Can you switch profiles without shutting down and restarting Outlook? If
so, this the proposed solution is great! If not, then I would still want to
find a way to change the outgoing mail servers "at the click of a button",
without having to stop/restart Outlook.

Thanks for the quick feedback. Much appreciated. :)
 
R

Robert Leitner

I can't seem to access the message using the link you provided. Can you tell
me what it says?
 
M

Michael Bauer

Hi Robert,

it´s the tread: Where do I find account settings?
in: microsoft.public.office.developer.outlook.vba
 
R

Robert Leitner

I apologize, but I am not that familiar with newsgroups. When I put

"
into my address bar, I get the following error:
===========================
430 no such article found

Configuration:
Account: msnews.microsoft.com
Server: msnews.microsoft.com
Protocol: NNTP
Port: 119
Secure(SSL): 0
Error Number: 430
Code: 800ccca6
==========================

How do I get to the message that you want me to look at?
 
M

Michael Bauer

Hi Robert,

please use Google for the search. There are options for searching in
Newsgroups with the subject and group name I gave to you.
 
R

Robert Leitner

Found it... thanks! So, after all that, it looks like it can be done the way
I would have hoped. :( Oh well.

Thanks for all your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top