Link to home
Start Free TrialLog 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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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