Broad Network


Perl Mailsend

PurePerl Sendail Program

Free to Download

Foreword: Written with Pure Perl, this module can be used to send mail from any computer that has Perl installed.

By: Chrysanthus Date Published: 21 Jul 2016

Introduction

Written with Pure Perl, this module can be used to send mail from any computer that has Perl installed. It is a single file module and needs a Perl program with the following variables and function, as you should use them.

#!/usr/bin/perl    
Start with the equivalent if you are not using Windows OS.

use Mailsend;
This includes the module into the program.

$Mailsend::MAIL_FROM = '<bob@example.org>';
This variable must be typed with its email address. This is the address to which an email will be sent to, by the email server if an error occurs in the transmission. It can be the same as one of the addresses in the From field.

@Mailsend::recipients = ('<alice@example.com>','<theboss@example.com>');
This array must be typed with at least one of the recipients address.

$Mailsend::From = '"Bob Example" <bob\@example.org>';
This variable must be typed with one or more email addresses, separated by commas, in a string. In this heading you have just one email address. It is for the person (or people) who wrote the email.

$Mailsend::Cc = '<person@example.com>';
The presence of this variable is optional. A copy of the email can be sent to the address (or addresses).

$Mailsend::Bcc = '<police@theaudit.com>';
The presence of this Blind Carbon Copy variable is optional.

$Mailsend::Subject = 'Welcoming the New Members';
This variable for the subject, must be present.

$Mailsend::Body = "something sometning sometning";
This variable, for the body of the letter, must be present. The string value can be very long.

Mailsend::sendmail();
This function must be used after the above has been typed. It sends the email to the email server (MSA, Mail Submission Agent), which sends the email to the destination. Returns 1 for success and 0 for failure.

Installation
Installation is easy. Just download the free Mail Send program from the following link:

Mailsend

It comes as a zipped directory. Unzip the directory and you will find the file (module), Mailsend.pm . Copy this file into the same directory as your Perl program that has the above code.

Mailsend.pm is a text file. Open the file with your text editor. Change the port and the domain name of your mail server from,

    my $remote_host = "localhost";
    my $port = 587;

to something like,

    my $remote_host = "mail.o2online.de";
    my $port = 25;

as necessary.

Save the file. Thatís all.

Discussion
Any problem or suggestion or comments you have about the program should be done at the following group. You may need to subscribe (freely) first.

Discussion Group

Related Links

Perl Basics
Perl Data Types
Perl Syntax
Perl References Optimized
Handling Files and Directories in Perl
Perl Function
Perl Package
Perl Object Oriented Programming
Perl Regular Expressions
Perl Operators
Perl Core Number Basics and Testing
Commonly Used Perl Predefined Functions
Line Oriented Operator and Here-doc
Handling Strings in Perl
Using Perl Arrays
Using Perl Hashes
Perl Multi-Dimensional Array
Date and Time in Perl
Perl Scoping
Namespace in Perl
Perl Eval Function
Writing a Perl Command Line Tool
Perl Insecurities and Prevention
Sending Email with Perl
Advanced Course
Miscellaneous Features in Perl
Perl Two-Dimensional Structures
Advanced Perl Regular Expressions
Designing and Using a Perl Module
More Related Links
Perl Mailsend
PurePerl MySQL API
Perl Course - Professional and Advanced
Major in Website Design
Web Development Course
Producing a Pure Perl Library

NEXT

Comments

Become the Writer's Follower
Send the Writer a Message