标签: sendgrid

PermError SPF永久错误:DNS查找太多

我配置了SPF和TXT记录.当我检查SPF记录语法时.它说PermError SPF永久错误:DNS查找太多.

 v=spf1 include:_spf.google.com include:netcore.co.in ~all 
Run Code Online (Sandbox Code Playgroud)

我的电子邮件也在垃圾邮件中登陆.

1)我在共享主机上,我没有配置专用的IP和DKIM.实际上我不发送垃圾邮件触发单词的电子邮件.因为我在共享主机上.共享主机上是否有其他可能发送电子邮件导致我的电子邮件在垃圾邮件中登陆.

2)我使用netcore.co.in发送群发邮件.和google.com从gmail发送邮件.我也正确配置了MX记录.我已经提到谷歌MX记录但不是netcore.net MX记录.我正在使用sendgrid的免费smtp服务器从我的java网络应用程序发送电子邮件.我没有在spf记录中提到过.SPF记录是否导致垃圾邮件问题.

email gmail spf spam sendgrid

8
推荐指数
1
解决办法
2万
查看次数

使用C#async在Azure上使用SendGrid发送电子邮件,等待

我正在按照本教程使用SendGrid从我的Azure Web角色发送电子邮件.

这是教程中的相关部分:

// Create credentials, specifying your user name and password.
var credentials = new NetworkCredential("username", "password");

// Create an REST transport for sending email.
var transportREST = REST.GetInstance(credentials);

// Send the email.
transportREST.Deliver(myMessage);
Run Code Online (Sandbox Code Playgroud)

在我看来,该transportREST.Deliver功能是同步的.由于它正在执行IO,我更喜欢使用新的.NET 4.5 异步,而是等待(我的所有其他代码都是完全异步的).这可能吗?是否有SendGrid的异步API或某种方式来包装现有的调用?

c# azure sendgrid async-await

8
推荐指数
1
解决办法
4014
查看次数

我可以为Sendgrid事件通知指定多个端点吗?

是否可以配置发送网格帐户,我可以指定多个发布事件URL事件通知.或者也许可以添加多个事件通知应用程序?

sendgrid

8
推荐指数
1
解决办法
2394
查看次数

Python Sendgrid发送带有PDF附件文件的电子邮件

我正在尝试将PDF文件附加到sendgrid发送的电子邮件中.

这是我的代码:

sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))

from_email = Email("from@example.com")
subject = "subject"
to_email = Email("to@example.com")
content = Content("text/html", email_body)

pdf = open(pdf_path, "rb").read().encode("base64")
attachment = Attachment()
attachment.set_content(pdf)
attachment.set_type("application/pdf")
attachment.set_filename("test.pdf")
attachment.set_disposition("attachment")
attachment.set_content_id(number)

mail = Mail(from_email, subject, to_email, content)
mail.add_attachment(attachment)

response = sg.client.mail.send.post(request_body=mail.get())

print(response.status_code)
print(response.body)
print(response.headers)
Run Code Online (Sandbox Code Playgroud)

但是Sendgrid Python库抛出错误HTTP Error 400:Bad Request.

我的代码出了什么问题?

python pdf email-attachments sendgrid

8
推荐指数
3
解决办法
8057
查看次数

如何获取Azure SendGrid api密钥?

我已按照如何使用SendGrid与Azure发送电子邮件的说明在Azure上设置SendGrid帐户.当我使用NuGet获取SendGrid包时,它是一个更新的版本(8.0.5 vs 6.3.4),因此实际发送电子邮件的示例不再有效.

所以,我转到了GitHub页面并查看了"快速入门"部分,看看新的api是如何工作的,我被卡住了 - 在世界上哪里可以找到/获取我的SendGrid api密钥?在我的Azure SendGrid帐户页面上找不到它.

SendGrid API密钥文档页面对API密钥管理的一些信息,但它相对于Azure的毫无意义使.

azure sendgrid

8
推荐指数
1
解决办法
3762
查看次数

为 Sendgrid 的电子邮件 API 编码 CSV 文件

我正在尝试使用 R/Python 和 Sendgrid 的电子邮件 API 构建客户端报告引擎。我可以发送电子邮件,但我需要做的最后一件事是附加客户的 CSV 报告。

我尝试了多种方法,包括对文件进行 base64 编码并将字符串从 R 写入磁盘到 python,但不是运气。也就是说,我似乎陷入了这个错误:

类型错误:“字节”类型的对象不是 JSON 可序列化的

我到达那里的代码是:

with open('raw/test-report.csv', 'rb') as fd:
     b64data = base64.b64encode(fd.read())
attachment = Attachment()
attachment.content = b64data
attachment.filename = "your-lead-report.csv"
mail.add_attachment(attachment)
Run Code Online (Sandbox Code Playgroud)

令人困惑的是,如果我简单地b64data用线替换

attachment.content = 'TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12'
Run Code Online (Sandbox Code Playgroud)

发送带有附件的电子邮件。

作为参考,我一直在使用:

https://github.com/sendgrid/sendgrid-python

厨房水槽教程

在我的项目的最后一步之前没有任何问题。

任何帮助将不胜感激。值得注意的是,我的强项是在R,但我通常可以python在互联网的帮助下一起破解。

python email sendgrid

8
推荐指数
1
解决办法
4296
查看次数

Sendgrid:使用模板版本支持多种语言

我想利用 Sendgrid 模板版本来支持多语言支持。

根据 Sendgrid文档

一个模板一次只能有一个活动版本。如果您创建了一个包含不同 HTML 的新版本,您希望客户开始接收该版本,则需要将该版本设为“活动”。

因此,例如我有 2 个版本的模板:English(active)Russian。因此,如果我想用俄语版本发送电子邮件,我需要在发送电子邮件之前激活俄语模板版本。

但我担心的是:如果我需要同时发送俄文和英文版本的电子邮件怎么办?Sendgrind 能否为 2 个同时请求提供合适的版本?

email sendgrid sendgrid-api-v3 sendgrid-templates

8
推荐指数
2
解决办法
5061
查看次数

错误配置用户 - 用户状态 - 暂停

我在 Heroku 中创建了一个新的 Sendgrid 插件:

heroku addons:create sendgrid:starter
Run Code Online (Sandbox Code Playgroud)

之后,我进入我的Sendgrid账户,它说我的账户被暂停(我刚刚创建,它是如何暂停的?)

所以,我有一个绝妙的主意(不是!):我已经删除了插件并尝试再次创建它。现在我从 Heroku 收到以下错误:

 An error was encountered when contacting the add-on partner to create sendgrid:starter: Error Provisioning User - User status - suspended
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

ruby-on-rails heroku sendgrid

8
推荐指数
1
解决办法
2652
查看次数

Rails 5.2 Net::SMTPAuthenticationError - 535 Authentication failed: account disabled When Sending Email (Localhost and Heroku)

I'm trying to get a Rails 5.2 mailer working, but am coming across a Net::SMTPAuthenticationError - 535 Authentication failed: account disabled error on both localhost and my Heroku production environment.

The mailer looks like this:

class AdminNotificationsMailer < ApplicationMailer
  default from: "liz@linchpinindustries.com"

  def new_rfp(rfp)
    @rfp = rfp
    mail(
      :to => "liz@linchpinindustries.com",
      :subject => 'New RFP Alert!'
    )
  end

  def new_contact_us(contact)
    @contact = contact
    mail(
      to: "liz@linchpinindustries.com",
      subject: 'New Contact Us Submission on LPI'
    )
  end

end
Run Code Online (Sandbox Code Playgroud)

With the trigger in …

ruby-on-rails sendgrid

8
推荐指数
2
解决办法
3521
查看次数

API 密钥不以“SG”开头。发送网格

我正在尝试在 Heroku NodeJS 应用程序中设置 SendGrid 插件。我创建了 API 密钥并将其设置为环境变量。

整个 API 密钥类似于:SG.actualValue.bbb_cccccc

我做的第一个设置我将整个密钥设置为我的 SENDGRID_API_KEY 并且我收到了这个错误:

API 密钥不以 SG 开头。

因此,我意识到错误并取消设置环境变量并将其重新设置为整个键的 actualValue 部分。

但是,我仍然遇到相同的错误。我尝试再次做同样的事情或重新启动终端(实际上是整个笔记本电脑)。

这是我试图从 SendGrid 设置页面运行的测试代码:

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
const msg = {
  to: 'test@example.com',
  from: 'test@example.com',
  subject: 'Sending with Twilio SendGrid is Fun',
  text: 'and easy to do anywhere, even with Node.js',
  html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sgMail.send(msg);
Run Code Online (Sandbox Code Playgroud)

我尝试创建一个新密钥并进行设置,但出现相同的错误。我尝试将其设置为整个密钥,但没有“.SG”或只是 bbb_ccccc 部分。先感谢您。

javascript email heroku node.js sendgrid

8
推荐指数
3
解决办法
7529
查看次数