Now I am using the gem *mailman *and it work properly on receiving the
email,
*mailman_server * require "rubygems"
require "bundler/setup"
require "mailman"
Mailman.config.logger = Logger.new("log/mailman.log")
Mailman.config.pop3 = {
server: 'pop.gmail.com', port: 995, ssl: true,
username: "[email protected]",
password: "lahore786"
}
Mailman::Application.run do
default do
begin
Ticket.receive_mail(message)
rescue Exception => e
Mailman.logger.error "Exception occurred while receiving
message:\n#{message}"
Mailman.logger.error [e, *e.backtrace].join("\n")
end
end
end
And run the command *script/mailman_server *and its work properly.
So it good approach which i mention above ??? or i try to use service provide
"sendgrid, cloudmailin, Amazon ses"???
On Sunday, July 23, 2017 at 4:41:11 PM UTC+5, Frederick Cheung wrote:
>
> On Saturday, July 22, 2017 at 3:55:48 PM UTC+1, Aqib Hameed wrote:
>
> > }I tried to run the command rails runner
> 'UserMailer.receive(STDIN.read)'
> >
> > But nothing happened even the email is incoming .It does not call
> the receive method
> > Where should i call the receive method ??? How determine the incoming
> email ???
>
> Receiving email is rather more involved than sending it.
> To use rails runner as you've tried this command needs to be run on your
> email server, by the email serving program itself (i.e. sendmail itself).
> There are variants on this but they all boil down to running your own mail
> server, which you may not want to do
>
> Alternatively there are services like sendgrid, cloudmailin, Amazon ses.
> You set you ready dns records to that email to your domain (or a subdomain)
> is handled by this service provider and they'll make a regular http(s) call
> to your app whenever an email is received.
>
> Fred
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/ec159bb3-63ae-4432-8f1c-0fa2cbea0d5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.