Tag: gmail

从Gmail Rails 3发送电子邮件

我正在尝试通过我的Gmail帐户发送电子邮件。 我直接从rails指南中复制了代码,并且在我的终端中它说它正在发送消息但是,我发送给它的地址没有得到它。 这是我在env.rb文件中的代码 config.action_mailer.deconfig.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => “smtp.gmail.com”, :port => 587, :domain => ‘derp’ :user_name => ‘derp.bot’, :password => ‘derp42069’, :authentication => ‘plain’, :enable_starttls_auto => true } 在终端中,我收到以下消息: Sent mail to derpviolin@gmail.com (20ms) Date: Wed, 16 Feb 2011 23:09:54 -0800 From: derp.bot@gmail.com To: derpviolin@gmail.com Message-ID: Subject: New Task Mime-Version: 1.0 Content-Type: […]

在尝试发送电子邮件时获取“必须首先发出STARTTLS命令”

我在尝试使用action_mailer_tls插件与我的Rails应用中的Gmail通信时遇到错误: Must issue a STARTTLS command first 其他人似乎遇到了同样的问题 : 问题是Gmail需要TLS身份validation,但标准的Ruby net / smtp库不支持TLS。 本文建议按照以下步骤操作: 当然,Marc Chung创建了一个有用的插件来克服这个障碍。 您可以在此处找到它并手动将其添加到项目中,也可以将其导出到插件目录中。 $ cd vendor/plugins $ svn export http://code.openrain.com/rails/action_mailer_tls/ 无论哪种方式,请确保您需要’smtp_tls’ 现在你需要的是更新你的smtp_settings,如果你还没有这样做的话。 ActionMailer :: Base.smtp_settings = { :address =>“smtp.gmail.com”, :port => 587, :domain =>“domain.com”, :user_name =>“user@domain.com”, :password =>“密码”, :authentication =>:plain } 任何有关与Gmail通信的更好解决方案的建议都将受到赞赏。

更改gmail密码时,Actionmailer无法正常工作

我有一个使用Gmail发送Actionmailer电子邮件的Rails应用。 它已经工作了好几个月,但现在我更改了我的Gmail密码,它已停止工作,我收到一个错误: Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted. 我在production.rb和development.rb文件中调整了新密码: config.action_mailer.smtp_settings = { address: ‘smtp.gmail.com’, port: 587, #domain: ‘thetens.us’, user_name: ‘myaddress@gmail.com’, password: ‘mypassword’, authentication: ‘plain’, enable_starttls_auto: true } 我确定密码是正确的。 有没有办法强制它更新它没有更新的地方?

成功安装action_mailer_optional_tls使用GMail发送?

我为Rails 2.3.2和Ruby 1.8.6安装了action_mailer_optional_tls,我无法让ActionMailer发送电子邮件! 我收到以下错误: 530 5.7.0必须首先发出STARTTLS命令 悲伤……有人有成功吗?

使用ruby-gmail阅读Gmail邮件

我正在寻找ruby-gmail gem中的一个实例方法,它允许我读取: 身体或 学科 的Gmail邮件。 在查看了这里找到的文档后,我找不到任何东西!? Gmail::Message类部分中有一个.message实例方法; 但是,由于缺乏一个更好的术语,它只会为身体发送电子邮件“mumbo-jumbo”。 我的尝试: #!/usr/local/bin/ruby require ‘gmail’ gmail = Gmail.connect(‘username’, ‘password’) emails = gmail.inbox.emails(:from => ‘someone@mail.com’) emails.each do |email| email.read email.message end 现在: email.read不起作用 email.message返回上面提到的“mumbo-jumbo” 有人在SO上提出这个问题,但没有得到答案。

使用ruby gmail api v0.9发送电子邮件

有没有人有一个简单的例子,说明如何使用v0.9 API从头开始发送电子邮件。 只想要一个发送以下内容的例子: m = Mail.new( to: “test1@test.com”, from: “test2@test.com”, subject: “Test Subject”, body:”Test Body”) 现在要创建需要发送的消息对象,我们可以使用: msg = Base64.urlsafe_encode64 m.to_s 然后尝试发送(其中message_object = msg): client = Google::Apis::GmailV1::GmailService.new #Appropriately authorised client.send_user_message(“me”, message_object) 客户端需要RFC822兼容的编码字符串,以上应该是。 我试过了: message_object = msg => Google::Apis::ClientError: invalidArgument: ‘raw’ RFC822 payload message string or uploading message via /upload/* URL required message_object = raw:msg =>ArgumentError: unknown […]

如何格式化Gmail的电子邮件?

我把电子邮件的正文包裹在 。 在gmail中显示原始文件实际上让我想要如何格式化电子邮件: Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Ant run name : Basics of Edumate Overall result : pass Ant run took: 4 minutes 15 seconds ————————– Details for all test suits ————————– login : Pass AddCycleTemplate: Pass AddCycleTemplate: Pass AddAcademicYear : Pass AddAcademicYear : Pass 但实际的电子邮件显示为一行。 请注意,我用于对齐的空格以某种方式被省略以及新行。 Ant run name : Basics […]

通过Gmail发送电子邮件,但配置不同的电子邮件地址

我正在尝试使用GMail的smtp服务器从我的rails应用程序发送电子邮件。 我发送的电子邮件看起来像是从我自己的Gmail地址发送的,而我希望它们来自info@myapp.com。 我使用三种方式身份validation配置了这个东西,我的应用程序有它唯一的密码。 这是我的production.rb config.action_mailer.default_url_options = { host: ‘my ip’, protocol: ‘https’ } config.action_mailer.delivery_method = :smtp config.action_mailer.asset_host = “https://my ip” 这是我的initializers/smtp.rb MyApp::Application.configure do config.action_mailer.smtp_settings = { enable_starttls_auto: “true”, address: “smtp.gmail.com”, port: “587”, domain: “mydomain.com”, authentication: :plain, user_name: ‘myusername@gmail.com’, password: ‘mypassword’ } end 可能吗? 我怎么能这样做?

使用Ruby为Gmail IMAP访问生成SASL XOAUTH2客户端响应

我正在尝试使用Ruby中的XOAUTH2通过IMAP访问我的Gmail电子邮件。 通过使用OAuth 2.0和oauth2 gem进行身份validation,我已经成功生成了访问令牌(和刷新令牌)。 我将使用gmail_xoauth通过IMAP访问Gmail。 因此,我现在需要根据Gmail XOAuth2文档生成SASL初始客户端响应: The SASL XOAUTH2 initial client response has the following format: base64(“user=” {User} “^Aauth=Bearer ” {Access Token} “^A^A”) using the base64 encoding mechanism defined in RFC 4648. ^A represents a Control+A (\001). 我不清楚我是如何在字符串中表示“Control + A”的。 我只是使用^A ? key = Base64.encode64(“user=#{email}^Aauth=Bearer #{access_token_obj.token}^A^A”) 这个python脚本使用\1代替^A 我也试过\001 。 无论我尝试什么,在使用结果validation(在irb中)时,我得到: >> imap = Net::IMAP.new(‘imap.gmail.com’, […]

使用rails导入gmail / yahoo / hotmail / aol地址簿

我想从他们的gmail / hotmail / yahoo和aol地址簿导入用户的地址簿。 我在rails中寻找一个gem / plugin,它可以帮助我做到这一点。 任何帮助表示赞赏。 谢谢。