edgeport - v1.0.3
    Preparing search index...

    Function smsAddress

    • Resolves the email-to-SMS gateway address for a phone number and carrier.

      The number is normalized to digits only (spaces, dashes, parentheses, dots and a leading + are removed). The carrier is either a known key from CarrierGateways - whose SMS or MMS domain is picked by opts.type (default 'sms', falling back to the SMS domain when no distinct MMS one exists) - or an unrecognized string treated as a raw gateway domain when it looks like one (contains a .).

      Parameters

      • number: string

        The recipient phone number in any common format.

      • carrier: string

        A known Carrier key or a raw gateway domain.

      • opts: { type?: "sms" | "mms" } = {}

        Options; type selects the SMS or MMS gateway (default 'sms').

      Returns string

      The number@domain gateway address.

      If the number is empty after normalization, or the carrier is neither a known key nor a plausible gateway domain.

      1.0.3

      import { smsAddress } from 'edgeport/smtp';

      smsAddress('+1 (555) 123-4567', 'att'); // '15551234567@txt.att.net'
      smsAddress('5551234567', 'verizon', { type: 'mms' }); // '5551234567@vzwpix.com'
      smsAddress('5551234567', 'sms.example.net'); // '5551234567@sms.example.net'