aliyun_email.go 598 B

123456789101112131415161718192021222324
  1. package services
  2. import (
  3. "eta_gn/eta_api/utils"
  4. openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
  5. dm "github.com/alibabacloud-go/dm-20151123/v2/client"
  6. "github.com/alibabacloud-go/tea/tea"
  7. )
  8. type AliyunEmail struct {
  9. Client *dm.Client
  10. }
  11. func (em *AliyunEmail) NewClient() (err error) {
  12. config := &openapi.Config{
  13. AccessKeyId: tea.String(utils.AliyunEmailAccessKeyId),
  14. AccessKeySecret: tea.String(utils.AliyunEmailAccessKeySecret),
  15. }
  16. config.Endpoint = tea.String("dm.aliyuncs.com")
  17. _result, _err := dm.NewClient(config)
  18. em.Client = _result
  19. err = _err
  20. return
  21. }