send mail

Forums Network Management ZeroShell send mail

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #42475

    Hi there, I’d like to send a mail when the sistem reboots , but I’m not able to do this 🙁 …..I tried to make a test with a script like this in cronjob , but doesn’t works


    use Net::SMTP;

    $remote_smtp_host = 'smtp.dominio.tld';

    $sender = 'indirizzo email del mittente';
    $sender_name = 'nome del mittente';

    $recipient = 'indirizzo email del destinatario';
    $recipient_name = 'nome del destinatario';

    $subject = ' Test';

    $body = "Questo e' un test dello script Sendmail.pln";

    $smtp=Net::SMTP->new("$remote_smtp_host") or die($!);
    $smtp->datasend("Subject: $subjectn");
    $smtp->datasend("To: $recipient_name n");
    $smtp->datasend("From: $sendername n");

    the zeroshell returns the following message

    /tmp/ScriptToRun21973: line 4: use: command not found
    /tmp/ScriptToRun21973: line 6: =: command not found
    /tmp/ScriptToRun21973: line 8: =: command not found
    /tmp/ScriptToRun21973: line 9: =: command not found
    /tmp/ScriptToRun21973: line 11: =: command not found
    /tmp/ScriptToRun21973: line 12: =: command not found
    /tmp/ScriptToRun21973: line 14: =: command not found
    /tmp/ScriptToRun21973: line 16: =: command not found
    /tmp/ScriptToRun21973: line 18: syntax error near unexpected token _('
    /tmp/ScriptToRun21973: line 18: __smtp=Net::SMTP->new("_remote_smtp_host") or die(_!);'

    [Cron mail]: ERROR (2)

    Maybe I’ve to install this pearl module ??

    How can I do it ?
    thanks !!


    With Zeroshell 3.3.2, there is a built-in feature “Monitoring”, which can send e-mails on various events and also at shutdown and restart.

    For manually sending mails, see “/usr/bin/smtp-cli –help”.


    using Monitor for emailing (via gmail) always get the message:

    Connect failed: IO::Socket::INET6: connect: timeout

    tried manually from smtp-cli got the same message

    can anyone help me ??


    I haven’t been able to get Gmail SMTP working in the Monitoring settings. Try using an SMTP email server on your LAN, maybe your router has an SMTP relay you could use or you could try using the SMTP settings of your ISP.

    Once operational the Monitoring Module is very convenient. Don’t forget to add your email recipients.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.