0

Right now I have a program that sends emails/texts via smtp (pony) with ruby. I want to know if there is a way to reverse it, so that I could text...

int a = 33
puts "whats good"

... and the program would redefine that variable and spit it back the string to me or something similar. any idea of how to do this? I think a ghetto way would be to email it and then have the program parse the email data each time. But it seems very inefficient to do so. Is there a way to do that directly with the program or the local server and not via 3rd party mail?

3
  • It is not clear exactly what your question is, and it may help if you show what you have done so far to solve your problem. Allowing emails/texts to run Ruby code directly on your server could be a security risk. I suggest at first you take a look at the eval keyword: ruby-doc.org/core-2.2.0/Kernel.html#method-i-eval Jan 25, 2015 at 7:08
  • yes I am asking about the way eval runs the code. I know there could be security issues, but if I am just working on a local simple thing I'm looking to get input without the computer. like how a spam texts will say "text 1 to cancel" (but in my case, enter a variable) and have the program respond a certain way depending on the response i give it. Pony.mail(:to => '[email protected]', :from => '[email protected]', :subject => 'hi', :body => 'Hello there.') I am just using simple pony expressions to send outbound stuff and just want a way to get input back from the recipient. Jan 25, 2015 at 8:06
  • Pony cannot receive email. If your project is Ruby on Rails, then read this: guides.rubyonrails.org/… . . . if it is not RoR, then please clarify with some code, how your app is set up, and how your email is set up (i.e. what receives the emails sent to the address that you set Pony to send from). Jan 25, 2015 at 9:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.