Use of attachements with sendMail action

Hi, today I took a new approach to get this command running.
Also @watou suggested this in another post.
But I failed.
When I looked into it I realized, that strange things happen here. :astonished:

Just for testing I thought I do it step by step. So I typed in the following commandline at the puTTY-console and pressed ENTER:
wget --output-document /home/openhabian/cam/test.jpg http://192.168.xxx.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=xxxxxxxxxxxxx&pwd=xxxxxxxxxxxxxxxx

What I don’t understand is: The console prompt appears and a new commandline is created automatically and is executed automatically!
And the valid url I had typed in has changed to a invalid url! As you can see here:
grafik

The created file /home/openhabian/cam/test.jpg is no picture, it’s a xml file with error code -2 = Username or password error. What could be expected, because of the invalid url: (Foscam FI9900P)

<CGI_Result>
    <result>-2</result>
</CGI_Result>

Can anyone explain this strange behavour?
Edit: Can anyone point me to a solution, how to get the cam-snapshot saved into test.jpg?
Regards.