如何在Spree发展中发送电子邮件 [英] How to Send Email in Development with Spree

查看:217
本文介绍了如何在Spree发展中发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正处于开发环境中,我想通过我的控制台发送测试电子邮件。我得到控制台不错,但它没有发送。



我去Spree的邮件方法设置,这里是我所得到的:





我已经仔细检查了密码。我已经把它弄死了。我不知道如何让这个东西工作。



关键问题:在开发环境中如何从Spree获取电子邮件?



我试过的东西 Spree Mail方法不起作用?

解决方案

问题是您需要可以接收的本地电子邮件服务器你的电子邮件要测试安装在开发中安装mailcatcher gem,您将用作开发中的SMTP服务器,捕获所有传入的邮件并在 http:// localhost:1080 /:



只需运行终端


gem install mailcatcher


然后在控制台中运行 mailcatcher 。一个玩具SMTP服务器将在端口1025上运行,捕获电子邮件并将其置于HTTP端口1080上。



然后只需转到spree管理面板并对其进行配置。以下设置对我而言完美无缺,无需编写代码。





点击发送测试邮件我在本地主机上收到以下电子邮件:




I'm in the development environment and I want to send out test emails via my console. I got the console going nice, but its not sending.

I go to Spree's Mail Method Settings and here's what I got:

I've double checked the password. I've Googled the hell out of it. I can't figure out how to get this thing to work.

Key Question: How does one get email working in Spree from the development environment?

Things I Tried: Spree Mail Method is not working?

解决方案

The problem is that you need a local email server that can receive your emails. To test the setup in development install the mailcatcher gem, that you will use as a SMTP server in development, catching all incoming mails and displaying them on http://localhost:1080/:

Just run in the terminal

gem install mailcatcher

then run mailcatcher in the console. A toy SMTP server will be running on port 1025 catching emails and displaing them on HTTP port 1080.

Then just goto the spree admin panel and configure it. The following settings work perfectly for me without any code writing.

After I clicked on send test mail I got the following email on my localhost:

这篇关于如何在Spree发展中发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆