I have my email hosted at Rackspace Email and would like to use that as my mail server for the contact form on my website.
Looking at the php.ini file, I\'m only abl
Setting up the internal mail function to use SMTP is only available on Windows. On other platforms, PHP should use the locally available sendmail or sendmail drop-in just fine.
If you want to use a SMTP under a non-Windows server you will have to use a third party library such as my favorite Switfmailer.
With Swiftmailer sending a email looks like this:
require_once 'lib/swift_required.php';
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password')
;
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('john@doe.com' => 'John Doe'))
->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
->setBody('Here is the message itself')
;
//Send the message
$result = $mailer->send($message);