edgeport - v1.0.3
    Preparing search index...

    Function sendSms

    • Sends a short plaintext message to a phone number via its carrier's email-to-SMS gateway.

      Resolves the gateway address with smsAddress, then sends a text-only message over the usual SMTP send path (connect, optional AUTH, send, quit). No HTML body is sent because gateways expect plain text.

      Parameters

      • opts: SendSmsOptions

        SMTP connection options plus the recipient, sender, and message text.

      Returns Promise<SendResult>

      The accepted recipients and the server's final reply.

      If the carrier or number is invalid, or the server rejects the message.

      If the socket cannot be opened.

      If authentication fails.

      1.0.3

      import { sendSms } from 'edgeport/smtp';

      await sendSms({
      hostname: 'smtp.example.com',
      auth: { username: 'me@example.com', password: 'app-password' },
      from: 'me@example.com',
      to: { number: '+1 (555) 123-4567', carrier: 'att' },
      text: 'Your code is 123456'
      });