gpt4 book ai didi

c# - 为什么我通过 SendGrid 发送的邮件在我的已发送项目中不可见? (.net核心)

转载 作者:行者123 更新时间:2023-12-03 05:41:48 28 4
gpt4 key购买 nike

我尝试使用.Net core在发送网格邮件服务的帮助下发送邮件。

var client = new SendGridClient(xxxxxxxxxxxxxxxxxxxxxx);
var from = new EmailAddress("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4034253334002122236e232f2d" rel="noreferrer noopener nofollow">[email protected]</a>", "Not User");
var subject = "TestMail";
var to = new EmailAddress("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="add9c8ded9edcccfce83cec2c0" rel="noreferrer noopener nofollow">[email protected]</a>, "Example User");
var plainTextContent = "This is body";
var htmlContent = "";
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
client.SendEmailAsync(msg).Wait();

使用此代码发送的邮件在我的邮箱的已发送项目中不可见。对此可能的解决方案是什么?提前致谢。

最佳答案

当您发送电子邮件时,它会直接使用 SMTP 发送至 sendgrid。当您通过 Google 发送时,他们会自动将其添加到您的发件箱。要在其他人发送邮件时执行相同的操作,您必须使用 IMAP 手动将已发送邮件的副本放入发件箱中。

What is the possible solution to this?

您可以使用 SendGrid 的 BCC option将允许您在发送的每封电子邮件中密件抄送电子邮件地址(在本例中为您的邮件帐户)。

转至您的 SendGrid 帐户>管理>设置>邮件设置 并打开 密件抄送选项。

enter image description here

注意:启用此设置后,您将需要为每发送一封电子邮件支付额外的费用。因此,重新单击管理,您将看到弹出消息。

这是发送邮箱快照:

enter image description here

关于c# - 为什么我通过 SendGrid 发送的邮件在我的已发送项目中不可见? (.net核心),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58211877/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com