- 浏览: 2556767 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Mail Server Solution(3)SendGrid
1. Set Up ngrok
https://ngrok.com/
Get the file from here https://dl.ngrok.com/ngrok_2.0.19_darwin_amd64.zip
Unzip the file and copy that to working directory, add it to the path.
This Command will verify if it is working
> ngrok -help
Command to Start
> ngrok http localhost:3000
Tunnel Status online
Version 2.0.19/2.0.19
Web Interface http://127.0.0.1:4040
Forwarding http://503def19.ngrok.io -> localhost:3000
Forwarding https://503def19.ngrok.io -> localhost:3000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
This will open a tunnel from the public URL to your localhost 3000 for testing purpose.
2. Set Up the Sample Codes
Create a Free account on app.sendgrid.com
https://github.com/sendgrid/sendgrid-parse-api-example nodeJS
https://github.com/Ziggeo/php-sendgrid-parse PHP
Go to the pages to set up the email forwarding on SendGrid
https://app.sendgrid.com/settings/parse
Add the domain name and forward URL there. I am using http://requestb.in/1gkr1qv1 for testing.
Adding the MX record to my domain name.
MX TTL - default (1 hour) - 10 mx.sendgrid.net.
Wait for 1 hour and Send the Email to my domain name.
I setup my domain name in both of these 2 places
https://portal.dynect.net/
http://www.networksolutions.com/
It works after few hours.
Here is the PHP solution(It seems too old.)
https://github.com/sendgrid/sendgrid-parse-demo
Here is the NODEJS solution
https://github.com/sendgrid/sendgrid-parse-api-example
Download the sample project NODEJS
> git clone https://github.com/sendgrid/sendgrid-parse-api-example.git
Change the configuration file
> mv .env.example .env
Change the content their to replace the username and password from SendGrid
Compile
> npm install
Start the Service
> node app.js
Verify if the application is running, should return 200
> curl -I -X POST http://localhost:3000/inbound
Use ngrok to get a public access
> ngrok http 0.0.0.0:3000
Then we will have something like
> curl -I -X POST http://f7df8a18.ngrok.io/inbound
Visit this page to watch the status
http://localhost:4040/inspect/http
You can check the activity on SendGrid
https://app.sendgrid.com/email_activity?
3. Understand the Sample NODEJS Codes
dotenv
https://github.com/motdotla/dotenv
HAPI - similar to ExpressJS
http://hapijs.com/
There is nothing special there, from my understanding, we just directly get the request payload and we get the attachments and attachment1, attachment2, attachment3 ...
References:
Mail Server Solution 1 & 2
http://sillycat.iteye.com/blog/2228923
http://sillycat.iteye.com/blog/2229222
Some Demos and Documents
https://sendgrid.com/
https://sendgrid.com/docs/API_Reference/Webhooks/parse.html
https://sendgrid.com/blog/sendgrids-parse-api-parsing-incoming-email-is-now-faster-and-easier/
https://sendgrid.com/blog/test-webhooks-ngrok/ test sendgrid with ngrok
https://github.com/sendgrid/sendgrid-parse-api-example
https://github.com/sendgrid/sendgrid-parse-demo
https://github.com/phpmasterdotcom/HandleEmailWithSendGrid
https://github.com/theycallmeswift/playlist.sendgriddemos.com
1. Set Up ngrok
https://ngrok.com/
Get the file from here https://dl.ngrok.com/ngrok_2.0.19_darwin_amd64.zip
Unzip the file and copy that to working directory, add it to the path.
This Command will verify if it is working
> ngrok -help
Command to Start
> ngrok http localhost:3000
Tunnel Status online
Version 2.0.19/2.0.19
Web Interface http://127.0.0.1:4040
Forwarding http://503def19.ngrok.io -> localhost:3000
Forwarding https://503def19.ngrok.io -> localhost:3000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
This will open a tunnel from the public URL to your localhost 3000 for testing purpose.
2. Set Up the Sample Codes
Create a Free account on app.sendgrid.com
https://github.com/sendgrid/sendgrid-parse-api-example nodeJS
https://github.com/Ziggeo/php-sendgrid-parse PHP
Go to the pages to set up the email forwarding on SendGrid
https://app.sendgrid.com/settings/parse
Add the domain name and forward URL there. I am using http://requestb.in/1gkr1qv1 for testing.
Adding the MX record to my domain name.
MX TTL - default (1 hour) - 10 mx.sendgrid.net.
Wait for 1 hour and Send the Email to my domain name.
I setup my domain name in both of these 2 places
https://portal.dynect.net/
http://www.networksolutions.com/
It works after few hours.
Here is the PHP solution(It seems too old.)
https://github.com/sendgrid/sendgrid-parse-demo
Here is the NODEJS solution
https://github.com/sendgrid/sendgrid-parse-api-example
Download the sample project NODEJS
> git clone https://github.com/sendgrid/sendgrid-parse-api-example.git
Change the configuration file
> mv .env.example .env
Change the content their to replace the username and password from SendGrid
Compile
> npm install
Start the Service
> node app.js
Verify if the application is running, should return 200
> curl -I -X POST http://localhost:3000/inbound
Use ngrok to get a public access
> ngrok http 0.0.0.0:3000
Then we will have something like
> curl -I -X POST http://f7df8a18.ngrok.io/inbound
Visit this page to watch the status
http://localhost:4040/inspect/http
You can check the activity on SendGrid
https://app.sendgrid.com/email_activity?
3. Understand the Sample NODEJS Codes
dotenv
https://github.com/motdotla/dotenv
HAPI - similar to ExpressJS
http://hapijs.com/
There is nothing special there, from my understanding, we just directly get the request payload and we get the attachments and attachment1, attachment2, attachment3 ...
References:
Mail Server Solution 1 & 2
http://sillycat.iteye.com/blog/2228923
http://sillycat.iteye.com/blog/2229222
Some Demos and Documents
https://sendgrid.com/
https://sendgrid.com/docs/API_Reference/Webhooks/parse.html
https://sendgrid.com/blog/sendgrids-parse-api-parsing-incoming-email-is-now-faster-and-easier/
https://sendgrid.com/blog/test-webhooks-ngrok/ test sendgrid with ngrok
https://github.com/sendgrid/sendgrid-parse-api-example
https://github.com/sendgrid/sendgrid-parse-demo
https://github.com/phpmasterdotcom/HandleEmailWithSendGrid
https://github.com/theycallmeswift/playlist.sendgriddemos.com
发表评论
-
Stop Update Here
2020-04-28 09:00 320I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 480NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 373Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 373Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 340Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 433Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 441Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 378Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 460VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 390Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 482NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 426Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 340Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 252GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 454GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 330GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 316Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 323Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 298Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 314Serverless with NodeJS and Tenc ...
相关推荐
注意,`MAIL_PASSWORD`字段应留空,因为SendGrid的API密钥将在`MAIL_USERNAME`中指定。确保你的SendGrid API密钥具有足够的权限,允许发送邮件。 在Laravel中发送邮件,你可以使用`Mail` facade或`Mailable`类。...
在代码实现上,通常会引入`SendGrid.Core`和`SendGrid.Helpers.Mail` NuGet包,这两个包提供了发送邮件所需的所有类和方法。接下来,创建一个邮件对象,设置收件人、主题和正文。使用`MailMessage`类可以创建邮件...
3. **性能优化**:SendGrid提供了高级的邮件跟踪和分析功能,可以帮助Magento商家了解邮件的打开率、点击率等关键指标,从而优化营销策略。 4. **垃圾邮件过滤**:由于SendGrid具有良好的信誉,使用其SMTP服务可以...
**3. 设置 SendGrid API 密钥** 在生成的配置文件 `config/sendgrid-newsletter.php` 中,输入你的 SendGrid API 密钥: ```php return [ 'api_key' => env('SENDGRID_API_KEY'), // ... ]; ``` 确保在 `.env` ...
sendgrid-python, 是 Hacktoberfest SendGrid如果你发出请求就会发出衬衫 ! :订阅电子邮件通知发布和中断更改。快速开始使用 Docker 。这个库让你可以快速方便地通过使用 ... 这个库的版本 3. X. X 为所有 SendG
docs, SendGrid产品文档 ! SendGrid文档 这里站点基于 Octopress,它又基于 of,并且添加了一些 Twitter Bootstrap 。开发分支持续部署到预览站点。 视图开发站点开发分支合并到生产周( 除非我们需要提前
from sendgrid.helpers.mail import Mail sg = sendgrid.SendGridAPIClient(api_key='your_sendgrid_api_key') ``` 2. 创建邮件对象: ```python from_email = Email('from@example.com') to_email = Email('to@...
可以使用`sendgrid-go`库提供的`mail.NewV3Mail()`创建一个邮件实例。 5. **SMTP设置与发送**:配置SMTP设置,包括API密钥和SMTP服务器地址,然后使用库提供的方法如`sendgrid.Send()`发送邮件。 6. **错误处理**...
sendgrid-nodejs, SendGrids官方社区 Led node.js 库 这个库使你能够快速轻松地通过使用 SendGrid Web API我们希望这个库是社区驱动的,而 SendGrid led 。 我们需要你的帮助来实现这个目标。 to我们以正确的顺序来...
该库的 3.X.X+ 版本为所有 SendGrid Web API v3端点提供完全支持,包括新的v3 /mail/send。此库代表着 SendGrid 新道路的开始。我们希望此库由社区驱动并由 SendGrid 主导。我们需要您的帮助来实现这一目标。为了...
3. **环境变量设置**:在`.env`文件中,添加你的SendGrid API密钥: ``` SENDGRID_API_KEY=your_sendgrid_api_key ``` 4. **使用Mail Facade**:Laravel的Mail facade使得发送邮件变得简单。在控制器或其他业务...
该库的 3.XX 版本为所有 Twilio SendGrid Web API v3端点提供完全支持,包括新的v3 /mail/send。这个库代表着 Twilio SendGrid 新道路的开始。我们希望这个库由社区驱动,由 Twilio SendGrid 主导。我们需要您的帮助...
3. MailGun: MailGun是Rackspace提供的邮件服务,专为开发者设计。它的库支持RESTful API接口,可用于发送、接收和处理电子邮件。MailGun提供了强大的路由功能,可以根据邮件内容自动处理,如转发、存储或触发特定...
标题"sendgrid-flask-mail:Flask和Flask-Mail应用程序示例,该应用程序通过Twilio SendGrid发送电子邮件" 提供了关键信息:这是一个使用Python的Flask框架和Flask-Mail扩展的示例应用。它利用Twilio SendGrid服务来...
该库的 3.XX 版本为所有 Twilio SendGrid Web API v3端点提供完全支持,包括新的v3 /mail/send。这个库代表着 Twilio SendGrid 新道路的开始。我们希望这个库由社区驱动,由 Twilio SendGrid 主导。我们需要您的帮助...
3. **易于集成**:只需简单配置,就可以将django-anymail集成到Django项目中,减少开发时间和复杂性。 4. **错误处理**:当邮件发送失败时,django-anymail会捕获并记录错误,便于调试和问题排查。 5. **模板兼容*...
SendGrid-Mock提供以下功能: 将邮件发送到模拟的sendgrid-api(v3: POST /v3/mail/send ) 包括身份验证通过API检索发送的邮件( GET /api/mails )。 您还可以按以下方式过滤这些邮件: GET /api/mails?to=email...