Golang AWS SES 邮件发送者错误

huangapple go评论87阅读模式
英文:

Golang AWS SES email bad sender

问题

我正在使用 AWS SES SDK 来进行 Golang 开发,它按计划工作,但我唯一的问题是,当我从 hi@domain.com 发送邮件时,在邮件的“发件人”位置上我看到的是“hi”,而不是我更喜欢的域名。我似乎找不到一个简单的解决方法。有人遇到过这个问题吗?我认为应该有一个简单的方法来解决这个问题。我的代码几乎与 SDK 中链接示例的代码相同。

英文:

I am using the AWS SES SDK for Golang and it works as planned, but the only issue I have is that I send my emails from hi@domain.com so when the email is received in the from place I see hi instead of the domain name which I would prefer and I can't seem to find an easy fix for it. Has anyone encountered this? I think there should be an easy way to solve the issue. My code is almost identical to the linked sample in the SDK.

答案1

得分: 1

在提供FromEmailAddress时,尝试使用以下格式:Nice sender name <sender@example.com>,这样你可以拥有域名,你可以这样写:

fromEmailAddress := "Example.com <sender@example.com>"
sesv2.SendEmailInput {
  FromEmailAddress: &fromEmailAddress, 
}
英文:

While providing FromEmailAddress in SendEmailInput struct try to use the following format Nice sender name &lt;sender@example.com&gt;, so to have the domain name you could have:

fromEmailAddress := &quot;Example.com &lt;sender@example.com&gt;&quot;
sesv2.SendEmailInput {
  FromEmailAddress: &amp;fromEmailAddress, 
}

huangapple
  • 本文由 发表于 2022年5月31日 23:57:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/72450862.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定