Acesta este un exemplu rapid despre “cum sa” folositi serverele noastre pentru a trimite mesaje tranzactionale:
<?php
require_once("lib/swift_required.php");
$transport = Swift_SmtpTransport::newInstance("HOST.nzmail.eu", 465, "ssl");
$transport->setUsername("USER");
$transport->setPassword("PASS");
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance()
->setSubject("test")
->setFrom(array("youremail@example.com" => "Test"))
->setBody("Ola this is a test !")
->addPart("Ola this is a HTML test !", "text/html")
->setTo(array("recipient@example.com" => "Catalin Constantin"));
$mailer->send($message);
?>
Aceste exemplu utilizeaza PHP si libraria Swiftmailer.