View Full Version : Sending email from another server

10-30-2007, 09:53 PM
Hey everyone!

I have a small problem and I was hoping that someone here could help me. Here it goes:

I'm hosting a website on a server that doesn't support mail() function. It's disabled or something and I have no way of contacting the webmaster to enable it or anything.

This company I'm doing this website for wants a contact form on their website. How do I do this? Is it possible that I could somehow forward data that user enters on the clients server to my server and use mail() function from my server?

Hope you know what I want. Thanks for any help.

Have a nice day,


10-30-2007, 10:07 PM
you could, or you could connect to an SMTP server and do it that way. something like Zend_Mail (a component of the Zend Framework) lets you do this quite easily:

require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';

$config = array('auth' => 'login',
'username' => 'myusername',
'password' => 'password');

$transport = new Zend_Mail_Transport_Smtp('mail.server.com', $config);

$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('sender@test.com', 'Some Sender');
$mail->addTo('recipient@test.com', 'Some Recipient');


10-30-2007, 11:07 PM
Thanks for this. I found another php mail class called phpmailer (there's also swiftmailer) that supports SMTP authentication.

Have fun,