T-Mobile电子邮件发送短信拒绝电子邮件

时间:2015-03-03 19:56:52

标签: ruby-on-rails email heroku sms pony

修改:显示many people are having this problem

我正在使用Pony电子邮件gem发送短信'在Ruby on Rails应用程序中拨打电话号码。它托管在Heroku上。当从Pony发送时,它适用于AT& T和Verizon,但不适用于T-Mobile。但是,当我从Gmail网络界面发送电子邮件时,短信会传送到T-Mobile号码

我认为某些电子邮件标头导致T-Mobile拒绝该电子邮件。以下是Gmail发送的电子邮件(隐藏的隐私信息):

MIME-Version: 1.0
Received: by 55.55.55.55 with HTTP; Mon, 2 Mar 2015 23:51:51 -0800 (PST)
Date: Mon, 2 Mar 2015 23:51:51 -0800
Delivered-To: valid.from.email@gmail.com
Message-ID: <CAN-5ELre3XqXgZQ-6_QGz7C=YXpAoZuTXPODHSmnZ=EOXA0Xwg@mail.gmail.com>
Subject: 
From: From Name <valid.from.email@gmail.com>
To: valid.10.digit.phone.number@tmomail.net
Content-Type: text/plain; charset=UTF-8

email content

这是Pony发送的电子邮件。我知道此电子邮件正在发送,因为它显示在Gmail网络界面中的已发送下。

Return-Path: <valid.from.email@gmail.com>
Received: from localhost.localdomain (ec2-55-555-55-555.compute-1.amazonaws.com. [55.555.55.555])
        by mx.google.com with ESMTPSA id g29sm577452ioi.35.2015.03.02.23.50.57
        for <valid.10.digit.phone.number@tmomail.net>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 02 Mar 2015 23:50:57 -0800 (PST)
Date: Tue, 03 Mar 2015 07:50:56 +0000
From: Frome Name <valid.from.email@gmail.com>
To: valid.10.digit.phone.number@tmomail.net
Message-ID: <54f567e08593f_33ff884d99e98497cf@d599820b-b537-4e60-bc52-671c771bf43c.mail>
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Delivered-To: valid.from.email@gmail.com

Pony Message content

这是我用来发送电子邮件的代码。

Pony.mail({
  :to => 'valid.10.digit.phone.number@tmomail.net',
  :body => 'Test Pony',
  :headers => { "Delivered-To" => "valid.from.email@gmail.com", 'Content-Type' => 'text/html' },
  :subject => 'Subject',
  :from => 'From Name <valid.from.email@gmail.com>',
  :via => :smtp,
  :via_options => {
    :address              => 'smtp.gmail.com',
    :port                 => '587',
    :enable_starttls_auto => true,
    :user_name            => 'valid.from.email@gmail.com',
    :password             => ENV['EMAIL_PASSWORD'],
    :authentication       => :plain, # :plain, :login, :cram_md5, no auth by default
  }
})

我怀疑可能导致问题的标题是ReceivedContent-Type(Pony电子邮件上有换行符)和Content-Transfer-Encoding标题。我无法弄清楚如何更改Pony中的任何值。

0 个答案:

没有答案