を返します。彼らが参照するコードは、あなたのメールをRackspace Cloudサイトで作業するために使用します...
非SSL
<?php
require_once "Mail.php";
$from = "Web Master <[email protected]>";
$to = "Nobody <[email protected]>";
$subject = "Test email using PHP SMTP\r\n\r\n";
$body = "This is a test email message";
$host = "mail.emailsrvr.com";
$username = "[email protected]";
$password = "yourPassword";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
SSLで
<?php
require_once "Mail.php";
$from = "Web Master <[email protected]>";
$to = "Nobody <[email protected]>";
$subject = "Test email using PHP SMTP with SSL\r\n\r\n";
$body = "This is a test email message";
$host = "ssl://secure.emailsrvr.com";
$port = "465";
$username = "[email protected]";
$password = "yourPassword";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
関連する質問こっちも
php mail function not sending emails/taking too long to send emails
彼らは問題が何であるかのいくつかを示唆しています。
http://www.joshuawinn.com/huge-email-delays-on-rackspace-cloud-sites-dont-use-php-mail
2つの迅速なアイデア:configファイルをリロードするとどのような権限本当にあなたの権限 – Cameron
権限をダブルチェック? – nivanka
編集中の 'php.ini'を使っていることを確認します。' phpinfo() 'が表示されているときに' php.ini'が '/ etc/php.ini'として表示されていることを確認してください。この問題は、serverfault.com – MrCode