Skip to content

Instantly share code, notes, and snippets.

@pobing
Created May 7, 2014 10:30
Show Gist options
  • Save pobing/08e89527740124d4e77d to your computer and use it in GitHub Desktop.
Save pobing/08e89527740124d4e77d to your computer and use it in GitHub Desktop.
pony send mail demo
require 'pony'
mails = {:to=>"[email protected]",
:subject=>"问答箱子找回密码",
:from=>"[email protected]",
:html_body=>"html body",
:via=>"smtp",
:via_options=>{
:address => 'smtp.exmail.qq.com',
:port => '25',
:user_name => '[email protected]',
:password => 'xxxxxx',
:authentication => :plain, # :plain, :login, :cram_md5, no auth by default
:domain => "localhost.localdomain" # the HELO domain provided by the client to the server
}}
Pony.mail(mails)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment