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.
36 lines
537 B
36 lines
537 B
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
"fmt"
|
|
email "MY/webapp/common/email"
|
|
)
|
|
|
|
func EmailReceiver(ctx context.Context) {
|
|
router, err := email.NewRouter(ctx, email.Config{
|
|
RedisHostPort: "127.0.0.1:6379",
|
|
SMTPHost: "localhost",
|
|
SMTPPort: 1025,
|
|
})
|
|
|
|
if err != nil { panic(err) }
|
|
defer router.Close()
|
|
|
|
for {
|
|
err := router.HandleEmailRequest()
|
|
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
ctx := context.Background()
|
|
|
|
go EmailReceiver(ctx)
|
|
|
|
time.Sleep(time.Second * 100)
|
|
}
|
|
|
|
|