Skip to content

Instantly share code, notes, and snippets.

@arbales
Created September 30, 2009 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbales/197817 to your computer and use it in GitHub Desktop.
Save arbales/197817 to your computer and use it in GitHub Desktop.
def send_upload_email(pcode, email)
begin
@pcode = pcode
Pony.mail(:to=>email,
:from => 'Pris.ma <do-not-reply@pris.ma>',
:subject=> "You uploaded a file on Pris.ma!",
:body => erb(:upload_email),
:via => :smtp, :smtp => {
:host => 'smtp.gmail.com',
:port => '587',
:tls => 'true',
:user => 'do-not-reply@youraccount.com',
:password => 'happyfuntime',
:auth => :plain,
:domain => "youraccount.com"
})
rescue
error(500, "Sorry, we could't send an e-mail to your address, check the spelling or delete it to skip-it.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment