The CAN-SPAM Act and TCPA provide regulations governing what email and SMS messages you can send to people and how you can send them.
Email marketing requires opt-in, as does SMS marketing. Email marketing services such as Mailchimp ask how you got your list of addresses, and how the opt-in was done. SMS services such as Twilio talk about opt-ins as well.
The question is in two parts. What is required for a legal opt-in, and what kinds of services have the opt-in requirement.
First, what exactly is required for opt-in? In this case, a single message invitation would be sent after someone you know provides your phone number. Basically a SMS or email friend request. Clearly you didn't give the service your phone number or email, but it wasn't generated by an auto-dialer or purchased from a bulk list. This is a communication from someone who claims to know you, inviting you to join a social service, but it is the service sending the message. If you decline or ignore the message, then you won't get more.
Second, is this actually considered Spam? The service would be sending you a single invite to join, with the name of your friend in the message, and no more messages unless you reply or sign up. Once you join, then we have a business relationship and the SMS messages or emails are transactional as part of the service. You can also turn off notifications or even quit the service at any time.
Reading online, most of the discussion seemed to only cover auto-dialer and list generated messages, not something as specific as my use-case. Transactional messages such as for password reset or account activity seem to always be allowed, and alerts or notifications seem to be okay as long as there is an opt-out or way to control what notifications are sent.
It's the single invite message that I don't know about. If I was getting the emails and phone numbers from lists or an autodialer, then I'd say it was unsolicited bulk marketing, and should have an opt-in first. But since the email/number is provided by an individual to invite you to interact with them on the service, I think the auto-dialed, bulk, and unsolicited categories don't apply. Even then, I would only send the invite message once to any user or phone number, no matter how many of their friends try to invite them.
I haven't been able to find anything authoritative to confirm or refute my theory though. I'm hoping someone here can tell me what law covers the email case and the SMS case, and if I can do this invite message legally without the recipient's prior opt-in. Also, if I can send a message, what language do I need to include in the message to ensure it is legal?