this example as it implements the SMTP functions required for implement SMTP applications in the Perl programming language. Most high level programming languages have similar libraries for imple- menting applications that require mail communication. a. SMTP Client using Net:: SMTP # SMTP Client # # Include Net : SMTP library use Net : SMTP qw (smtp) ; # Create a Net : : SMTP object my $mailer = Net : : SMTP->new ("smtp.crcpress.com") ordie$@; # SMTP commands can now be accessed with "mailer" object # The SMTP server is smtp.crcpress.com # Send a sample message to postmaster at the SMTP Server $mailer->mail ("user\@crcpress.com") ; $mailer->to ("postmaster\@crcpress.com") ; # Initiate the sending of data $mailer->data ( ) ; Fundamentals of EMS, NMS and OSS/BSS # Mention the sender the way it needs to appear in the message # The actual sender is user@crcpress.com $mailer->datasend ("From: jithesh\@crcpress.com\n") i # Mention the receiver the way it needs to appear in the message # The actual receiver is postmaster@crcpress.org $mailer->datasend ("To: lohanley\@crcpress.com"\n\n\n") ; # Specify the body of the message $mailer->datasend ("Test Mail\n") # End the message $mailer->dataend(); $mailer->quit or die "mail sending failure"; b. SMTP Server implementation using Net::SMTP::Server # SMTP Server # # Include libraries use Carp; use Net::SMTP::Server; use Net ::SMTP::Server::Client; use Net: : SMTP::Server::Relay # Create a Net : SMTP: : Server object $receiver = new Net: : SMTP: : Server ( localhost', 25) ; # Specify address and port for running the Server # SMTP commands can now be accessed with "receiver" object # Accept Connection from Client while ($conn = $receiver->accept ) { # Handle the client's connection my $sender = new Net: : SMTP: : Server: : Client ($conn) # A better option is to spawn off a new parser for handling the client # This can be implemented as a new thread or using fork ( ) # Process the client. . $sender->process next; # This will ensure that the connecting client completes the SMTP tra