Hi, When someone insert a invalid e-mail (I think) they get it: 550 <ffff>: Recipient address rejected: User unknown in local recipient table How can I show my own message??? Thank you! -- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035
How about just make email validation? Pedro Valentini wrote:> Hi, > When someone insert a invalid e-mail (I think) they get it: > 550 <ffff>: Recipient address rejected: User unknown in local > recipient table > How can I show my own message??? > Thank you! >
But... How to validate e-mails?? But it can''t be a valid e-mail: invalidemails-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org Thank''s Pedro Ilya V. Sabanin escreveu:> How about just make email validation? > > Pedro Valentini wrote: > >> Hi, >> When someone insert a invalid e-mail (I think) they get it: >> 550 <invalid-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org>: Recipient address rejected: User unknown in >> local recipient table >> How can I show my own message??? >> Thank you! >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >-- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035
Pedro: perhaps you can provide some more details? What''s going on in your application? where the (potentially invalid) email comes in? where the exception arises? what you want to have happen on an email address improperly formed? on an email address that goes nowhere? etc? The answer is roughly: catch the exceptions raised by #deliver_whatever, then deal with them appropriately (-- you may or may not want to do this synchronously, depending on the details --); and define your own #rescue_action_in_public to deal with application errors as you wish. On 5/25/05, Pedro Valentini <pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org> wrote:> But... > How to validate e-mails?? > But it can''t be a valid e-mail: invalidemails-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org > > Thank''s > Pedro > > Ilya V. Sabanin escreveu: > > > How about just make email validation? > > > > Pedro Valentini wrote: > > > >> Hi, > >> When someone insert a invalid e-mail (I think) they get it: > >> 550 <invalid-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org>: Recipient address rejected: User unknown in > >> local recipient table > >> How can I show my own message??? > >> Thank you! > >> > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > > Pedro C. Valentini > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > +55 (21) 8708-8035 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Chris Boone http://hypsometry.com/ : website edification http://uvlist.org/ : free classifieds for the Upper Valley
Add the following validation to your model object validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/, :on => :save Pedro Valentini wrote:> But... > How to validate e-mails?? > But it can''t be a valid e-mail: invalidemails-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org > > Thank''s > Pedro > > Ilya V. Sabanin escreveu: > >> How about just make email validation? >> >> Pedro Valentini wrote: >> >>> Hi, >>> When someone insert a invalid e-mail (I think) they get it: >>> 550 <invalid-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org>: Recipient address rejected: User unknown in >>> local recipient table >>> How can I show my own message??? >>> Thank you! >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >
It will help but ActionMailer return a ugly error when I try to send a e-mail and the e-mail go to anyware (but is valid by the regullar expression) do you understand? When I try to send e-mail to a invalid destination(invalid-oiMenFwlSli10fLO9P142F6hYfS7NtTn@public.gmane.org) by actionmailer happen an error?? Thank you David and Chriss David Teare escreveu:> Add the following validation to your model object > > validates_format_of :email, :with => > /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/, :on => :save > > > Pedro Valentini wrote: > >> But... >> How to validate e-mails?? >> But it can''t be a valid e-mail: invalidemails-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org >> >> Thank''s >> Pedro >> >> Ilya V. Sabanin escreveu: >> >>> How about just make email validation? >>> >>> Pedro Valentini wrote: >>> >>>> Hi, >>>> When someone insert a invalid e-mail (I think) they get it: >>>> 550 <invalid-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org>: Recipient address rejected: User unknown >>>> in local recipient table >>>> How can I show my own message??? >>>> Thank you! >>>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >-- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035