Files
mailx/cmd/main.go
T
2025-08-30 17:58:23 +08:00

31 lines
450 B
Go

package main
import (
"context"
"code.yun.ink/pkg/mailx"
"code.yun.ink/pkg/mailx/interfaces"
)
func main() {
ctx := context.Background()
ch := mailx.Platform
em, err := ch.GetEmail(interfaces.EmailTypeSmtp)
if err != nil {
panic(err)
}
// 使用em进行后续操作
em.SetOption(ctx, interfaces.SetSmtp(&interfaces.EmailConfigDataSmtp{}))
err = em.Send(ctx, interfaces.Message{
Form: "",
})
if err != nil {
panic(err)
}
}