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.

32 lines
766 B

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