ePages 6.10 - DE_EPAGES/MailType/API/Object/SmtpConnection.pm

Package DE_EPAGES::MailType::API::Object::SmtpConnection

object interface for an SMTP Connection.

Base
DE_EPAGES::Mail::API::SMTP
Example
my $Smtp = DE_EPAGES::MailType::API::Object::SmtpConnection->new;
$Smtp->open;
$Smtp->send( "This is a test", {
    'FROM'      => 'Sender <mailer@epages.de>',
    'TO'        => ['Recipient <rcpt@epages.de>'],
    'SUBJECT'   => 'Hallo',
} );
$Smtp->close;

Functions

close
new
open
send

close

closes a connection to the SMTP server

Syntax
$Connection->close();

new

Creates a new SmtpConnection object using the SMTP server that is configured by the attributes SMTPServer and SMTPPort of the System object.

Syntax
$Connection = DE_EPAGES::MailType::API::Object::SmtpConnection->new();
Return
$Connection (object)
SMTP connection object

open

opens a connection to the SMTP server

Syntax
$Connection->open();

send

Send the e-mail using the SMPT connection

Syntax
$Connection->send( $MailBody, $hParams );
Example
$Connection->send( $Mail->createMail(), $Mail->getHeader());
Input
$MailBody (string)
MIME message body
$hParams (ref.hash.string)
E-Mail headers and envelope parameters, see
DE_EPAGES::Mail::API::SMTP::sendDataToSMTP