PierreForget has asked for the wisdom of the Perl Monks concerning the following question:
I have a server which is local (192.168.0.10) and I know mailx works correctly, because I can send an email directly from the terminal, even if I am local. This is the beauty of SimpleSMTP.
I have a program that sends an email with ssmtp (SimpleSMTP) via mailx. If the email is sent and there is no error, the user gets the sms and the web user gets back to the main menu page. If there is an error (Telus blocks me after a few tries), I tried to catch it with the END statement to send it back to the main menu, but it doesn't work.
Here is the code, with dummy email and domain: It's part of a sub:
In the web site logs, I get "mailx: ... message not sent:".
Thanks in advance.
$courrielclient="5555555555\msg.telus.com"; $textecourriel = "Ceci est un test de message texte (SMS)"; $sujet = "Test de rappel de rendez-vous $nomfournisseurcellulaire"; $from = "nepasrepondre\@testsms.ca"; open( my $mail, "| mailx -r $from -s $sujet $courrielclient"); say ("$mail $textecourriel"); close $mail; END { my $redirect = "/cgi-bin/chiro/menuprincipal.pl"; print "Location:$redirect\n\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: catch die from say
by eyepopslikeamosquito (Archbishop) on Apr 01, 2024 at 10:42 UTC | |
by jdporter (Paladin) on Apr 01, 2024 at 13:17 UTC | |
by PierreForget (Acolyte) on Apr 01, 2024 at 18:01 UTC | |
by PierreForget (Acolyte) on Apr 01, 2024 at 18:35 UTC | |
by eyepopslikeamosquito (Archbishop) on Apr 02, 2024 at 00:19 UTC | |
by PierreForget (Acolyte) on Apr 02, 2024 at 14:18 UTC | |
by PierreForget (Acolyte) on Apr 01, 2024 at 23:27 UTC | |
Re: catch die from say
by stevieb (Canon) on Apr 01, 2024 at 19:23 UTC | |
by PierreForget (Acolyte) on Apr 01, 2024 at 23:08 UTC | |
Re: catch die from say
by jdporter (Paladin) on Apr 01, 2024 at 01:59 UTC | |
by kcott (Archbishop) on Apr 01, 2024 at 06:01 UTC | |
by Corion (Patriarch) on Apr 01, 2024 at 07:23 UTC | |
by ikegami (Patriarch) on Apr 01, 2024 at 13:41 UTC | |
by Timka (Acolyte) on Apr 01, 2024 at 06:11 UTC |