using unix mail to email outside my ISP network

I tried using the following script to send an email using the unix mail command. It only works if I send an email to the email account I got from my ISP. It doesn’t work if I send an email to a different email account like one on aol, yahoo etc. Note that the command executes properly no matter who I send the email to, but it only arrives when I send it to my isp email account. Anyone know why? I assume it’s because I don’t have a smtp server set up with unix mail, but maybe someone can tell me a simple way to fix the problem?

set messTo to ""
set messFrom to ""
set messSub to "Message subject"
set messBody to "body"

do shell script "echo " & (quoted form of "" & messBody) & " | mail -s " & (quoted form of messSub) & " " & messTo & " -f " & messFrom