Call to member function setusername() on a non object
Posted: Thu May 03, 2007 8:43 am
Well through the list of noob problems i'm almost done.
Now i'm hitting this error
Fatal error: Call to a member function setUsername() on a non-object in /home/pinehead/www/dennis/new/send_newsletter.php on line 16
Thanks for the help guys
Now i'm hitting this error
Fatal error: Call to a member function setUsername() on a non-object in /home/pinehead/www/dennis/new/send_newsletter.php on line 16
Code: Select all
$swift =& new Swift(new Swift_Connection_SMTP("mail.pinehead.com", 25));
$smtp->setUsername("user@pinehead.com);
$smtp->setPassword("password");
$message =& new Swift_Message("Some subject", "Your message <u>here</u>", "text/html");
if ($swift->send($message, "recipient@domain.tld", "you@home.tld"))
{
echo "Message sent";
}
else
{
echo "Message failed to send";
}
//It's polite to do this when you're finished
$swift->disconnect();
That is my code not including the requires.