Skip to content

{ error_code: 999, message: 'Badly formed incoming data' } #38

Description

@chuve

Try to send email via smtpSendMail method and get the next error in response { error_code: 999, message: 'Badly formed incoming data' }

import sendpulse from 'sendpulse-api';

const config = {
  SEND_PULSE_API_USER_ID: 'user_id',
  SEND_PULSE_API_SECRET: ''secret,
  SENDER_EMAIL_FROM_NAME: 'name',
  SENDER_EMAIL_FROM_ADDRESS: 'sender@example.com'
}

const TOKEN_STORAGE = '/tmp/';

const FROM = {
  name: config.SENDER_EMAIL_FROM_NAME,
  email: config.SENDER_EMAIL_FROM_ADDRESS,
}

sendpulse.init(config.SEND_PULSE_API_USER_ID, config.SEND_PULSE_API_SECRET, TOKEN_STORAGE, function () {
  var email = {
    html: '<h1>Example text</h1>',
    text: 'Example text',
    subject: 'Example subject',
    from: FROM,
    to: [
      {
        name: 'Piter',
        email: 'some@domain.net',
      },
    ],
    bcc: [
      {
        name: 'John',
        email: 'some@domain.info',
      },
    ],
  };
  sendpulse.smtpSendMail((data) => console.log(data), email);
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions