深化smtp文件的支持
This commit is contained in:
@@ -15,7 +15,7 @@ func ExampleUsage() {
|
||||
smtpClient := NewSmtp()
|
||||
|
||||
// 配置SMTP设置
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.EmailOption) {
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
opt.Smtp = &interfaces.EmailConfigDataSmtp{
|
||||
Host: "smtp.gmail.com",
|
||||
Port: "587", // STARTTLS
|
||||
@@ -37,7 +37,7 @@ func ExampleUsage() {
|
||||
Subject: "测试邮件 - Enhanced SMTP",
|
||||
Body: "<h1>这是一封测试邮件</h1><p>支持HTML格式和多种功能。</p>",
|
||||
ReplyTo: "noreply@example.com",
|
||||
Attachment: []interfaces.MessageAttachment{
|
||||
Attachment: []interfaces.Attachment{
|
||||
{Content: "path/to/attachment.pdf"},
|
||||
},
|
||||
}
|
||||
@@ -56,7 +56,7 @@ func ExampleSSLUsage() {
|
||||
|
||||
smtpClient := NewSmtp()
|
||||
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.EmailOption) {
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
opt.Smtp = &interfaces.EmailConfigDataSmtp{
|
||||
Host: "smtp.gmail.com",
|
||||
Port: "465", // SSL
|
||||
@@ -87,7 +87,7 @@ func ExampleEnterpriseEmail() {
|
||||
smtpClient := NewSmtp()
|
||||
|
||||
// 企业邮箱通常使用587端口和STARTTLS
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.EmailOption) {
|
||||
_, err := smtpClient.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
opt.Smtp = &interfaces.EmailConfigDataSmtp{
|
||||
Host: "smtp.exmail.qq.com", // 腾讯企业邮箱
|
||||
Port: "587",
|
||||
|
||||
Reference in New Issue
Block a user