On our last trip I bought post cards and stamps in every port and mailed them from that port. I was told ships mail would not go out until the ship reached an American port, I don't know if that was true or not.
Each port either had a post office near the port or in the mail shopping area, or had a shop set up selling post cards and stamps and arraigning mailing.
The only problem I had was in Grand Turk where the operator of the little post office shop closed up about an hour after we got there and then wondered around drinking and visiting with the other shop owners.
All of my post cards made it home with no significant problems.
Non-US cost $1-$2 for airmail, Porto Rico and US Virgin Islands used standard US first class postage.