[horde] About framework

http://www.pas-world.com dev001 at pas-world.com
Mon Feb 11 19:54:42 UTC 2008


Hello,
I searching class that have support for smime.
Manage Openssl with .cgi is very poor, only text/plain. Some classes
have a good multipart support but do not for smime. (any suggestion?)

For this reason, I am searching new php class, or library that manage
MIME and SMIME.
At this moment, I test horde framework, but have some problems.
- requires php function, do not work in some cases (pear file and
lib/Horde files, not found). This is ease solved with full path.

My test works, but before continue. I need know if I can manage easy a
smime mail. Could be ease, or not? How to?
Any examples to manage smime messages? Documents explaining classes?
Any suggestion are welcome.
Thanks in advance.



My test.php:
        			global $conf;
        
        		$HordeDirLib= '/usr/share/horde/lib/Horde';
        		require_once ($HordeDirLib.'/MIME.php');
        		require_once ($HordeDirLib.'/MIME/Headers.php');
        		require_once ($HordeDirLib.'/MIME/Message.php');
        		require('/usr/share/pear/Mail.php');
        		//		$m2= new Horde_Crypt_smime();
        
        		// Add user's name to the email address if provided.
        		/*if ($name) {
        			@list($mailbox, $host) = @explode('@', $email, 2);
        			if (empty($host)) {
        				$host = $conf['problems']['maildomain'];
        			}
        			$email = MIME::rfc822WriteAddress($mailbox, $host, $name);
        		}*/
        
        		$msg_headers = &new MIME_Headers();
        		$msg_headers->addReceivedHeader();
        		$msg_headers->addMessageIdHeader();
        		$msg_headers->addAgentHeader();
        		$msg_headers->addHeader('Date', date('r'));
        		$msg_headers->addHeader('To', 'customer at mail.com');
        		$msg_headers->addHeader('Subject', _("[Problem Report]") . '
        ' . 'Este es el título');
        		$msg_headers->addHeader('From',
        'Pericolospalotes at palotes.es');
        		$msg_headers->addHeader('Sender', 'yomismo at mail.com');
        
        		$mime = &new MIME_Message();
        		$mime->addPart(new MIME_Part('text/plain',String::wrap('El
        contenido del mensaje.....', 80,
        "\n"),/*NLS::getCharset()*/'UTF-8'));
        		$msg_headers->addMIMEHeaders($mime);
        		$mime->addPart(new
        MIME_Part('text/html',String::wrap('<html>helllo</html>', 80,
        "\n"),/*NLS::getCharset()*/'UTF-8'));
        		$msg_headers->addMIMEHeaders($mime);
        
        		$mail_driver = $conf['mailer']['type'] = 'sendmail';
        		$mail_params = $conf['mailer']['params'] = '';
        /*		if ($mail_driver == 'smtp' && $mail_params['auth'] &&
        empty($mail_params['username']))
        		{
        			if (Auth::getAuth())
        			{
        				$mail_params['username'] = Auth::getAuth();
        				$mail_params['password'] = Auth::getCredential('password');
        			} elseif (!empty($conf['problems']['username']) && !
        empty($conf['problems']['password']))
        			{
        				$mail_params['username'] = $conf['problems']['username'];
        				$mail_params['password'] = $conf['problems']['password'];
        			}
        		}
        */
        		if (!is_a($sent = $mime->send('customer at secure.mail.com',
        $msg_headers, $mail_driver, $mail_params), 'PEAR_Error'))
        		{
        			echo "Email enviado";
        		} else
        		{
        			echo "Fallo enviando el correo";
        		}
-- 
--
Publicidad http://www.pas-world.com



More information about the horde mailing list