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?
asmtp connection script
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: asmtp connection script
You need to create $swift with:
Code: Select all
$swift = new Swift($smtp);