Page 1 of 2

How do I get a MX Server name ...

Posted: Mon Apr 12, 2004 11:16 am
by Christian
... from a mailadress?

Hi!

My problem is following: I want to code a form that I want to include into my program. A user who uses my software should be able to send a mail to me with this form. I already started coding something and with some code snippets of the CodeArchiv I also get successful with sending a mail. But in my tests I already knew the MX-Server (Mail Exchange Server/SMTP-Server) of the mailadress I send the mail with. As you can imagine is there a problem if I give my program away: The MX-Server of every user will be a different and I need a method with which I can determine the MX-Server of a specific maildomain.

So for example: Mr. Testguy got y software and want to send me a mail. He fills in all fields of the form - including one field for his mailadress. Know I can get the domain of the adress. (so e.g. mail@domain.de -> "domain.de") And with this information I want to determine the MX-Server of this domain.

But how can I do this? Does anybody know? If so it would be nice if that person could share this knowledge with me. :)

thank you,
Christian

Posted: Mon Apr 12, 2004 11:24 am
by Berikco
The MX record is not used to send mail, it is for receiving mail for that domain.

you need the SMTP server from the persons ISP to send mail.

Posted: Mon Apr 12, 2004 11:47 am
by Christian
So MX-Server and SMTP Server are not the same things? I thought so. Could you explane the difference to me?

OK ... so please replace all "MX" I used in my first posting with "SMTP". :)

regards,
Christian

Posted: Mon Apr 12, 2004 11:47 am
by LarsG
can you get away with doing:

Code: Select all

RunProgram("mailto:somebody@somewhere.xxx?subject=Trallalla")
:?:
it will use the clients standard mail-setup...

Posted: Mon Apr 12, 2004 11:50 am
by Christian
No that isn't the thing I want. Because with that I would use the standard mail client. I really want to have a form inside my program. But thank you.

regards,
Christian

Posted: Mon Apr 12, 2004 12:15 pm
by Berikco
First you will have to find the customers default mail client...
And than you wil have to find the smtp server in the clients mail program settings....

It's easy, only a dozen email clients out there :)
Outlook
Outlook Express
Eudora
Pegasus
The Bat
...
And if the client is using Outlook with Exchange server, there is no SMTP server data in the registry on his local machine...

This is the way most new virusses with build in SMTP sender do it, they use the SMTP settings from outlook (or outlook express), so they dont work on systems that dont have outlook configured.

Posted: Mon Apr 12, 2004 12:35 pm
by Christian
Berikco wrote: And if the client is using Outlook with Exchange server, there is no SMTP server data in the registry on his local machine...

This is the way most new virusses with build in SMTP sender do it, they use the SMTP settings from outlook (or outlook express), so they dont work on systems that dont have outlook configured.
But that would be a problem. I really want that every user can use the form than. Apart from that: Is it legal to read this information from other programs?

regards,
Christian

Posted: Mon Apr 12, 2004 12:54 pm
by thefool
cant you just use your own smpt-server? If we say i have mine as smtp.com, just connect and send mail. Some smtp uses passwords and users, but some are free too.

Posted: Mon Apr 12, 2004 1:23 pm
by Karbon
There isn't much way to just find an SMTP server that the user connects to. I could literally be anything in the world!

Prompt for that information and save it somewhere for later use - it's what I do and it's the only effective way to do it if you don't want to send email using the client's standard email client..

Posted: Mon Apr 12, 2004 1:47 pm
by Christian
@thefool:
The problem with that is: In the case I have to change the server for some reason the contact form becomes useless. Another problem with that is the return adress.

@Karbon:
So you mean to collect information about all providers and their mailservers? So you don't think there is a way to get the SMTP-server from the mailadress?

regards,
Christian

Posted: Mon Apr 12, 2004 2:13 pm
by thefool
what about you have a file on the internet somewhere. on your server, maybe. The client program downloads the file, and then the file holds the smtp server adress. That way you can change it easly. It requires a server, though.

Or what about setting up your own smtp-server? While im at the server stuff, why not just make a client and a server app. the client sends a message to your server, and you view it when you come home.

Posted: Mon Apr 12, 2004 2:15 pm
by thefool
Christian wrote: So you mean to collect information about all providers and their mailservers? So you don't think there is a way to get the SMTP-server from the mailadress?
Christian
my email adress has nothing to do with my smtp server. Only my pop3. You cant get the smtp from a mailadress.

Posted: Mon Apr 12, 2004 2:32 pm
by Christian
@thefool:
The file stuff could be a opportunity. I'll think about that ... :)
my email adress has nothing to do with my smtp server. Only my pop3. You cant get the smtp from a mailadress.
While I did my research I found this: http://mailserver.aplerbeck.net/#auskunft
I think it shows that it is possible. Just type a mailadress in the field.

regards,
Christian

Posted: Mon Apr 12, 2004 2:40 pm
by thefool
it gets my pop3 not my smtp.

Posted: Mon Apr 12, 2004 3:18 pm
by Christian
thefool wrote:it gets my pop3 not my smtp.
Oops .. :oops: