I think you might have figured it out here.
ChangeAgent, go ahead and try the last two suggestions (-L and --data-binary).
However, I think the problem is due to login (or lack thereof).
Note that the -o option of the curl command renames the file according to the string which follows (in your case /Users/me/Desktop/gespr_dat.csv.gz).
Now, if the file it's getting is an HTML file, and you're giving it a .gz extension, that's going to confuse archive tools 'til the cows come home.
Give your file a .html extension, and open it up. What happens?
Now, you can use curl to set a login and pass, assuming the webserver in question doesn't require these to be entered in silly fields in a web browser window.
Question: when logging in to download this file via Safari, are you prompted for login via a popup window, or via fields in a normal browser window?
Note: You can easily automate normal shell scripts with cron. Read the following:
http://www.adminschoice.com/crontab-quick-reference
Note also that my script deletes the original file outright (rather than merely moving it to the trash), which would seem to be actually more time-saving in this instance. Anything that can be scripted doesn't need to be saved in the trash. =)
And finally, note that it's very easy to send files via email using the command line (or a shell script). To do this, the sendemail client is probably the best and lightest-weight way to do it.
http://caspian.dotconf.net/menu/Software/SendEmail/
Not necessary to do anything complicated; it's just a perl script, so no need to compile it or anything. Just download it and execute it like you did your shell script. If you want to make it so that you can just type "sendemail" at the prompt (rather than having to type its path first), you can do the following:
sudo mv /pathto/sendemail /usr/bin
(Note that either way you'll probably have to make it executable like you did for your shell script, e.g. "chmod +x /pathto/sendemail". You'll have to use "sudo chmod +x /pathto/sendemail" if you put it into /usr/bin first, due to permissions.)
To send a file using sendemail (you can put this in your shell script, once you get everything else working), check out the following examples:
http://www.debianadmin.com/how-to-sendemail-from-the-command-line-using-a-gmail- account-and-others.html
Shell scripting is a good way to do these kind of automated tasks, as you're ensuring the absolute minimum amount of overhead (which is always a good thing for automated tasks which are executed while you might be doing other things).