Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Sending email, would like a success (or failure) page to display

by choroba (Cardinal)
on Jun 13, 2015 at 20:04 UTC ( [id://1130316]=note: print w/replies, xml ) Need Help??


in reply to Sending email, would like a success (or failure) page to display

As the documentation says, the success object is returned from the sendmail subroutine.
if (sendmail($email)) { # On success }

Without success, the subroutine thows an exception, i.e. dies. Therefore, without evaling the subroutine (or using something like Try::Tiny), you don't have to check the success.

if (eval { sendmail($email) }) { # On success... } else { # On failure }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Sending email, would like a success (or failure) page to display
by tonto (Friar) on Jun 13, 2015 at 20:19 UTC

    Thank you!

    I read the documentation but I didn't understand how to apply it, I am wiser now.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1130316]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-09-16 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.