流星邮件也不发送

流星邮件也不发送

本文介绍了即使设置了MAIL_URL环境变量,流星邮件也不发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在终端中收到此错误消息,邮件未发送;启用发送,设置MAIL_URL环境变量。尽管设置了MAIL_URL环境变量。在这个消息之后,整个邮件内容html被转储到终端中。我使用2个流星包发送电子邮件:yogiben:漂亮的电子邮件和邮件与mailgun api服务。



这是邮件配置和发送电子邮件的源代码:

 如果Meteor.isServer 
Meteor.startup - >
process.env.MAIL_URL ='smtp://sandboxid.mailgun.org:[email protected]:587'
return


PrettyEmail。 options =
from:'[email protected]'

siteName:'Meteor Test'
companyAddress:'sdfsf,gdfg-df'
companyName:'代码创建'
companyUrl:'http://example.com'

Accounts.sendVerificationEmail - >
Meteor.userId()

此文件保存在Project_Directory / both / _config目录中。我正在本地ubuntu服务器上开发此应用程序。

解决方案

我遇到同样的错误。诀窍是不要在应用程序中包含MAIL_URL,而是在运行流星本身的终端中。



使用以下命令运行流星:



MAIL_URL =smtp:// postmaster @ sandbox ** **。mailgun.org:[email protected]:587流星



我在Ubuntu终端上尝试过,所以应该在Mac上工作。 p>

I'm getting this error message in the terminal "Mail not sent; to enable sending, set the MAIL_URL environment variable." despite setting MAIL_URL environment variable. After this message the whole mail content html gets dumped in the terminal. I'm using 2 meteor packages for sending email: yogiben:pretty-emails and email with mailgun api service.

Here's the source code for the mail config and sending email:

if Meteor.isServer
    Meteor.startup ->
        process.env.MAIL_URL = 'smtp://sandboxid.mailgun.org:[email protected]:587'
        return


    PrettyEmail.options =
        from: '[email protected]'

        siteName: 'Meteor Test'
        companyAddress: 'sdfsf, gdfg-df'
        companyName: 'Code to Create'
        companyUrl: 'http://example.com'

    Accounts.sendVerificationEmail ->
        Meteor.userId()

This file is kept inside Project_Directory/both/_config directory. I'm currently developing this app on local ubuntu server.

解决方案

I came across the same error. The trick was to not include the MAIL_URL in the application, but in the terminal where you run meteor itself.

Use the following command to run meteor:

MAIL_URL="smtp://postmaster@sandbox****.mailgun.org:[email protected]:587" meteor

I tried this on Ubuntu Terminal, hence should work on Mac as well.

这篇关于即使设置了MAIL_URL环境变量,流星邮件也不发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 17:40