ruby - Connection refused when using Pony Mail & Sinatra -


I have a lot of trouble with Pony Mail Mani to work with my Sinatra website (posted on Heroko). I am targeting to create a basic contact form where a visitor can fill email and subject, their email and phone number, and this form will send information to e-mail to customers.

Here is the code for the form:

  & lt; Form action = "/ emailform" method = "post" & gt; & Lt; P & gt; We would love to hear from you! & Lt; / P & gt; & Lt; Input type = "text" placeholder = "your full name" name = "full_name" & gt; & Lt; Input type = "text" placeholder = "your email * required" name = "email" & gt; & Lt; Input type = "text" placeholder = "your phone number" name = "phone number" & gt; & Lt; Input type = "text" placeholder = "topic" name = "topic" & gt; & Lt; textarea rows = "5" cols = "30" name = "comments" placeholder = "comments" & gt; & Lt; / Textarea & gt; & Lt; Input type = "submit" value = "submit" placeholder = "send" & gt; & Lt; / Form & gt;   

Here is the code for my actions.rb file (post request) (3 points represent more parameters / form fields)

  post ' / emailform 'pony. Mail: 'xxx@gmail.com', from: 'xxx@gmail.com', subject: 'From e-mail:' + [Params [full_name] + parameters [: Email], body: "subject:" + The ultimate [: subject] + "phone number:" + parameter [: phononumber] ... redirects' / 'and' post '/ home illusion' is to pony. From Mail: 'xxx@gmail.com', From: 'xxx@gmail.com', Subject: 'Home Evaluation E-mail:' + Ultimate [: Full_name], Body: 'Phone Number:' + Parameters [: PhoneNumber] + Paramos [: Comments] ... Redirect / / End   

I am getting the error now

  Erro :: Ekineted - Connection Rejected - Connect (2):   

I'm seeing this by seeing everybody's logs.

I was struggling with this issue for some time and can not find any useful information online. If someone has used gem or knows any other way to complete the same work then I would love to hear it!

This setup looks like a problem are doing? We use Send Grids, so we need these lines somewhere in the code:

  Pony Option [: via medium] [: user_name] = ENV ['SENDGRID_PASSWORD'] Pony.options [: via_options] [: password] = ENV ['SENDGRID_USERNAME']   

Edit: More Dictionary Options

  Pony Option = {by: smtp, via_options: {address: "smtp.sendgrid.net", port: "587", domain: "heroku.com", authentication :: plain, enable_starttls_auto: true, user_name: "foo @ heroku. Com ", password:" Foo "}}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -