E-Mail APIs, POP3, IMAP, MailDir, SMTP support.
usepeer\mail\{Message, InternetAddress};
$msg= newMessage();
$msg->setFrom(newInternetAddress('friebe@example.com', 'Timm Friebe'));
$msg->addRecipient(TO, newInternetAddress('foo@bar.baz', 'Foo Bar'));
$msg->addRecipient(CC, newInternetAddress('timm@foo.bar', 'Timm Friebe'));
$msg->setHeader('X-Binford', '6100 (more power)');
$msg->setSubject('Hello world');
$msg->setBody('Testmail');usepeer\mail\transport\{MailTransport, TransportException};
$smtp= newMailTransport();
try {
$smtp->connect();
$smtp->send($msg);
} catch (TransportException$e) {
$e->printStackTrace();
}
$smtp->close();usepeer\mail\transport\{SmtpConnection, TransportException};
$smtp= newSmtpConnection('esmtp://user:pass@mail.example.com:25/?auth=login');
try {
$smtp->connect();
$smtp->send($msg);
} catch (TransportException$e) {
$e->printStackTrace();
}
$smtp->close();
