muquit / mailsend

A program to send mail via SMTP from command line
Other
294 stars 68 forks source link

Working directly from cmd prompt, but same cmd in batch script fails #101

Closed zeeter82 closed 7 years ago

zeeter82 commented 7 years ago

The cmd works fine running it directly from cmd prompt window, but as a batch script it fails with:

Error: AUTH LOGIN failed: '535 Incorrect authentication data'

The cmd is below:

mailsend1.19.exe -t user@server.net -f user@server.net -ssl -port 465 -auth -smtp smtp.server.net -sub "LOGON ALERT" +cc +bc -M "Logon Alert - USER has logged in remotely." -user user@server.net -pass "mYp@ssW0rd" -v

I tried setting the pass using the env variable as well, but still get 535 failure. The password is complex and contains special characters, but it works directly from cmd prompt. Not sure why the batch file is processing it in a different way. And yes I did try running as administrator with the same results. I don't think this cmd requires elevated permissions anyways.

muquit commented 7 years ago

Only thing I can think of is how the file is created. It's possible that content is written in Unicode and when the program ran the password is decoded to something else other than the real one. mailsend has issues with 8 bit character sets in Windows. Thanks.

zeeter82 commented 7 years ago

I fixed it finally :)

I have a % in the password and I wasn't escaping it correctly for the env variable. Thanks!