I do not want to use mail()
to send e-mail. I would like to connect to the SMTP server directly.
Is there a class to do this job?
Zend_Mail can do this for you:
$tr = new Zend_Mail_Transport_Smtp('mail.example.com');
Zend_Mail::setDefaultTransport($tr);
$mail = new Zend_Mail();
$mail->addTo('studio@example.com', 'Test');
$mail->setFrom('studio@example.com', 'Test');
$mail->setSubject('Subject');
$mail->setBodyText('...Your message here...');
$mail->send();
You have a list of existing smtp classes here
SwiftMailer does this.
http://swiftmailer.org/