A
A
Anton2021-11-10 00:39:56
System administration
Anton, 2021-11-10 00:39:56

Is it possible to send an external ip address to an e-mail via a bat script?

Greetings!
Tell me, is it possible to send an ip address to your e-mail using cmd / bat? If it is possible that interests an example.
Maybe there are ready-made scripts or examples.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2021-11-10
@saboteur_kiev

Can. There are plenty of console smtp clients. But you need a mail server that will accept a request from a remote server, and that's another matter.

R
res2001, 2021-11-10
@res2001

Can.
Only you first need to find out this external address, and then send it by mail.
Both of these tasks cannot be solved by means that are in cmd by default.
But if you use not cmd, but WSH (the same is in Windows by default, JScript / VBS) or posh, then this will make the task easier and it will already be possible to solve it without resorting to third-party tools.

O
Olgeir, 2021-11-10
@Olgeir

If you completely rest against the decision on CMD, then you can:
1. Download the page https://yandex.ru/internet
using wget 2. Cut out the IP address with anything, for example, grep
3. Send the result to the mail using blat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question