it's a little confusing when you say it "works properly" because it looks like it isn't working at all. in any case, for you to use gmail as a mail sender (smtp), the sender has to be you. so, basically, you send the mail to yourself. identifying the actual sender would be trivial. you might want to set up a second gmail account specifically for this purpose.
i don't know if gmail is the only provider to offer this service; there may be others. but i'm pretty sure they're going to work in a similar fashion: only the account holder can send mail. nothing illegal about sending mail to yourself.
did you follow the
instructions for setting up gmail as an smtp server? i know i have used it at some point, but i can't find the test app i tried it with.
i hope it's clear