
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 1.30 KB | hits: 12 | expires: Never
Minimizing Zend Framework to Zend_Mail? [closed]
<?php
// optionally
// set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/Zend');
require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Sendmail.php';
$transport = new Zend_Mail_Transport_Sendmail();
$mail = new Zend_Mail();
$mail->addTo('user@domain')
->setSubject('Mail Test')
->setBodyText("Hello,nThis is a Zend Mail message...n")
->setFrom('sender@domain');
try {
$mail->send($transport);
echo "Message sent!<br />n";
} catch (Exception $ex) {
echo "Failed to send mail! " . $ex->getMessage() . "<br />n";
}
<?php
require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';
$config = array(//'ssl' => 'tls',
'port' => '25', //465',
'auth' => 'login',
'username' => 'user',
'password' => 'password');
$transport = new Zend_Mail_Transport_Smtp('smtp.example.com', $config);
$mail = new Zend_Mail();
$mail->addTo('user@domain')
->setSubject('Mail Test')
->setBodyText("Hello,nThis is a Zend Mail message...n")
->setFrom('sender@domain');
try {
$mail->send($transport);
echo "Message sent!<br />n";
} catch (Exception $ex) {
echo "Failed to send mail! " . $ex->getMessage() . "<br />n";
}