Hi I don't know much about windows scripting but I have this case where I need to connect to my email server with different protocols for testing and I need to telnet those constantly which is very useless thing to do over and over again so I thought I should write a windows script so I can automate having to type the same thing over and over again.
This is what I have so far:
echo off
title Login to Mail using IMAP,POP3 and SMTP
echo Please enter the protocol required (POP3=1,IMAP=2,SMTP=3)&
set /P id= Enter Value :
echo You have selected option :%id%
IF %id%==1(
telnet <ip address> 110
user user@example.com
pass 123
)
IF %id%==2(
telnet <ip address> 143
a login user@example.com 123
)
IF %id%==3(
telnet <ip address> 25
helo r
auth login
<base64encodedusername>
<base64encodedpassword>
)
The commands itself works as expected when I type them on cmd but it wouldn't work in the batch file. I'm assuming my syntax for conditional statements is the culprit but I am not sure. Can anyone help?