Solved

I need to Changes Letter OutHouing Server on-fly

Posted on 2002-03-30
3
134 Views
Last Modified: 2010-04-04
Problem synopsis:
I am using several internet providers to get into Internet (there are several Internet Connections on my PC)
Each internet provider has his own SMTP server (outgouing server). If i decide to change the Internet connection - i begin using an Internet Connection that differs from my default Internet Connection - then i start having problems with sending letters because new Internet Connection has different SMTP server.
Of cause I can change SMTP server for all mail accounts in my Outlook but it is not useful if i change Internet Connection often or If I use other mail client program (the Bat)

Problem solution:
1. Manually change SMTP server for all accounts in my Mail Client Program(OutLook,  The Bat, ect) everytime when i change Internat Connection. (VERY INCONVENIENT and I don't want to do it)
2. Change SMTP for each letter that is going to be send on the System level. (I don't know how :( ).

I would like to make a program that will determine what Internet Connection is active and depending on this connection will change the mail OUTGOUING server on fly.
0
Comment
Question by:penich
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 300 total points
ID: 6908545
There are free RAS/DialUp components available for Delphi which will allow you to monitor the state of your connections. Now, whenever a connection is made, I'd replace the HOSTS file with one customized fr your needs. The HOSTS file is a text file which is used when Windows tries to resolve host names before it queries a DNS server. Therefore, if you define a a name there (for instance, "SMTP") and set its IP depending on the provider SMTP server, you'll not have to change the configuration of any email application.

Windows 95/98/ME:
The HOSTS file (NO extension!) is to be found in the WINDOWS directory. The file may not yet exist, but there will at least be a HOSTS.SAM (SAMple) file which you can use as template.

Windows NT/2000/XP:
The HOSTS file is to be found in the (windows)\SYSTEM32\DRIVERS\ETC directory.

RAS components:
http://www.torry.net/ras.htm
0
 

Author Comment

by:penich
ID: 6935928
Thanks a lot AvonWyss!!!
I tested what you told me and figured out that it works
I appritiate it and already use this program
If you are interesting in it - here is the program i wrote
http://penich.tomsk.ru/SMTPSwitch.exe
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6936945
penich, glad that I was able to help! Since I have a cable connection here, I don't need to switch ISPs, but I appreciate you posting the link here. Have a nice weekend!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now