Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-Mail-Box/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-Mail-Box/examples/send.pl
#!/usr/bin/perl

# Demonstration on sending simple messages.
#
# This code can be used and modified without restriction.
# Mark Overmeer, <mailbox@overmeer.net>, 20 nov 2001
# 16 jan 2003, added some options

use warnings;
use strict;
use lib '..', '.';

use Mail::Box;

#
# Get the command line arguments.
#

die "Usage: $0 email-address\n"
    unless @ARGV==1;

my $email = shift @ARGV;

#
# Create a simple message
#

my $message = Mail::Message->build
  ( From    => 'me@localhost.com'
  , To      => $email
  , Subject => 'A sunny day'
# , Cc      => 'NINJA <ninja>, Mark Overmeer <markov>'

  , data => <<'TEXT'
This is an automatically generated message.
I hope you have a nice day.
TEXT
 );

#
# Transmit the message, leaving the decission how over to the
# Mail::Transmit package.
#

warn "Sending returned error $!\n"
   unless $message->send;

$message->send
  ( via        => 'sendmail'      # you can do even without this line
# , trace      => 'NOTICE'
# , executable => 'C:\lib\sendmail.exe'
# , debug_smtp => 1
# , timeout    => 300
# , retry      => 5
  );

Hry