asmtp connection script
Posted: Thu Jan 01, 2009 11:50 am
hi there,
because my provider requests asmtp (http://strato-faq.nl/view.php4?articleid=147)
i changed the script to;
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
$smtp =& new Swift_Connection_SMTP("smtp.strato.com", 25); //mostly localhost
$smtp->setUsername("webmaster@xxxx.nl");
$smtp->setPassword("xxxxx");
$message =& new Swift_Message("Huren carnavalswagen", $message, "text/html");
if ($swift->send($message, "info@xxxx.nl", "webmaster@xxxxnl"))
{
echo "Bedankt. U krijgt zo spoedig mogelijk reactie.";
}
else
{
echo "Om technische redenen is er geen mail verstuurd. Stuur ons een mail naar xxx@xxx.nl";
}
$swift->disconnect();
But now i get the nect error;
Fatal error: Call to a member function send() on a non-object in /mnt/web8/50/87/51957987/htdocs/Praalwagens/post.php on line 115
What did i do wrong?
because my provider requests asmtp (http://strato-faq.nl/view.php4?articleid=147)
i changed the script to;
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
$smtp =& new Swift_Connection_SMTP("smtp.strato.com", 25); //mostly localhost
$smtp->setUsername("webmaster@xxxx.nl");
$smtp->setPassword("xxxxx");
$message =& new Swift_Message("Huren carnavalswagen", $message, "text/html");
if ($swift->send($message, "info@xxxx.nl", "webmaster@xxxxnl"))
{
echo "Bedankt. U krijgt zo spoedig mogelijk reactie.";
}
else
{
echo "Om technische redenen is er geen mail verstuurd. Stuur ons een mail naar xxx@xxx.nl";
}
$swift->disconnect();
But now i get the nect error;
Fatal error: Call to a member function send() on a non-object in /mnt/web8/50/87/51957987/htdocs/Praalwagens/post.php on line 115
What did i do wrong?