easysms 2.1.1 copy "easysms: ^2.1.1" to clipboard
easysms: ^2.1.1 copied to clipboard

Easy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.

example/main.dart

import 'package:easysms/easysms.dart';
import 'package:easysms/tencentcloud.dart';

void main() async {
  final gateway = TencentCloudSmsGateway(
    appId: '<You app ID>',
    secretId: '<You secret ID>',
    secretKey: '<You secret key>',
  );
  final easysms = EasySMS(
    gateways: [gateway],
  );

  final message = Message.fromValues(
    template: '<You template ID>',
    data: {
      'SignName': "<You sign name>",
      'TemplateParamSet': [
        '<Param 1>',
        '<Param 2>',
        // ...
      ],
    },
  );

  // Change 86 to your country code.
  final phone = PhoneNumber(86, '<You phone number>');
  final response = await easysms.send([phone], message);

  print('Status: ${response.first.success}'); // true or false
}
4
likes
150
points
59
downloads

Publisher

verified publisherodroe.com

Weekly Downloads

Easy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

crypto, http

More

Packages that depend on easysms