Tom's Guide | Tom's Hardware | Tom's Games | PC Safety Suite
![]() |
![]() |
![]() |
Comment:
Hi,
I'm using blat (http://www.blat.net/) to send emails from batch-scripts. (w2k command environment) I always used sent my emails directly to the smpt-server name, but that will not work anymore. Instead I need to request the smtp servername from dns by reading the MX-record.For this, I can type
nslookup -querytype=mx [domainname] <enter>The results look similar to:
scct.emea.company.com MX preference = 20, mail exchanger = cli-location-195.scct.emea.company.com
scct.emea.company.com MX preference = 10, mail exchanger = cli-location-194.scct.emea.company.com
scct.emea.company.com nameserver = kate.company.comI need to store into a variable the results:
a) cli-location-195.scct.emea.company.com
b) cli-location-194.scct.emea.company.comI have tried to use the "="sign as delimiter with following commandline:
FOR /F "tokens=1,2,3 delims==" %a in ('nslookup -type=mx scct.emea.fedex.com') do set SMTPSERVER=%cBut this results in error: Non-existent domain (probably the nslookup command needs DNS input from reverse-lookup but i guess this is not possible in my 'FOR' statement above).
Does someone have any suggestions how to achieve this?
Thanks in advance!
Igor.
+1 | ![]() |
To be clear.... I'm interested in:
a) Having a scripting solution (for commandline tools like Blat)
-AND-
b) Having a VB6 solution (VB-control) to allow built-in sendmail functionality within my VB application.Any help will be greatly appreciated!
Kind regards,
Igor.
![]() |
Batch file that can do ma...
|
Sieve of Eratosthenes C p...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.