You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
768 B

  1. package service
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/utils"
  4. )
  5. type EmailService struct {
  6. }
  7. //@author: [maplepie](https://github.com/maplepie)
  8. //@function: EmailTest
  9. //@description: 发送邮件测试
  10. //@return: err error
  11. func (e *EmailService) EmailTest() (err error) {
  12. subject := "test"
  13. body := "test"
  14. err = utils.EmailTest(subject, body)
  15. return err
  16. }
  17. //@author: [maplepie](https://github.com/maplepie)
  18. //@function: EmailTest
  19. //@description: 发送邮件测试
  20. //@return: err error
  21. //@params to string 收件人
  22. //@params subject string 标题(主题)
  23. //@params body string 邮件内容
  24. func (e *EmailService) SendEmail(to, subject, body string) (err error) {
  25. err = utils.Email(to, subject, body)
  26. return err
  27. }