Link to home
Create AccountLog in
Avatar of convtech2
convtech2

asked on

Windows batch file to telnet to SMTP server and send email

I have a batch file that telnets to a SMTP server, and emails error codes on some SQL backups.

Everything works except where you're supposed to send a . on a line by itself.

It doesn't seem to recognize the '.', so it doesn't get to the quit command.

If I watch the script, I can put the . in with the keyboard, but it defeats the purpose of having a scheduled task.

Without getting into a 3rd party software, would anybody have any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of btassure
btassure
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Try putting two "return" lines under the ".".

For example.
..your code..

.


<end of script>

Also, i would use NetCat, (nc.exe), rather than telnet.
Avatar of convtech2
convtech2

ASKER

the crlf under the . doesn't work.
I'll try Blat