Thanks Michal, This is brilliant, just a couple of questions: 1. Where do I get SENDGRID_USERNAME and SENDGRID_PASSWORD from, or are they set up automatically when I install the Sendgrid addon? 2. What do I change the HELO domain to?
cheers, DAZ On Aug 23, 11:53 am, misza222 <[email protected]> wrote: > Hi Daz, > > How about that: > ============== > post '/contact' do > require 'pony' > Pony.mail( > :to => 'your-email-address', > :from => params[:from], > :subject => params[:subject], > :body => params[:content], > :via => :smtp, > :via_options => { > :address => 'smtp.sendgrid.net', > :port => '587', # 587 for encryption > :enable_starttls_auto => true, > :user_name => ENV['SENDGRID_USERNAME'], > :password => ENV['SENDGRID_PASSWORD'], > :authentication => :plain, > # :plain, :login, :cram_md5, no auth by default > :domain => 'change-that-domain.com' # the > HELO domain provided by the client to the server > }) > flash[:notice] = "Thank you for your e-mail." > > redirect '/' > end > =============== > Add necessary checks on params, change HELO domain and it's done I > suppose. > > Michal > > On Aug 22, 8:41 pm, DAZ <[email protected]> wrote: > > > > > Hi, > > > I'm using Sinatra and would like to create a very simple contact page > > that will send me an email when filled in. > > > Is this possible on Heroku using Sendgrid and Pony? Do I need to also > > use a gmail account? > > > Has anybody got any experience of this or advice? > > > cheers, > > > DAZ -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
