API
First you need to get an API key.
For PHP you may use a simple class to work with My Messages.
Install via Composer:
composer require it-poet/mymsg

Sending to any email addresses and Telegram user:
$send = new \ItPoet\Mymsg\MymsgApi;
$send->apiKey = '4602e70fb399ee4602e3db34602ef343d284602e';
$send->email1 = 'test@test.com';
$send->email2 = 'test2@test.com';
$send->fromTitle = 'John Smith';
$send->fromAddress = 'jsmith@test.com';
$send->replyTo = 'jsmith@test.com';
$send->telegram = '123456789';
$send->subject = 'Hi!';
$send->message = 'Some text.';
$send->protocol = 'https';
$send->sendTo();
Telegram recipient must get his ID using @mymessbot's command /whoami.

Sending to registered My Messages user:
$send = new \ItPoet\Mymsg\MymsgApi;
$send->apiKey = '4602e70fb399ee4602e3db34602ef343d284602e';
$send->userOrCode = 'goodguy';
$send->subject = 'Hi!';
$send->message = 'Some text.';
$send->protocol = 'https';
$send->sendToUser();