I have downloaded SwiftMailer Plugin But I cannot send mails.The error is
Fatal error: Call to undefined method Swift_Connection_SMTP::send()
I dont understand the error.Please give me a solution
Reg:SwiftMailer Send Error
Moderators: Chris Corbyn, General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Accidentally posted to a new thread:
esther wrote:Hello Sir,
Below is the code that i gaveBut i got a error in send() function.Code: Select all
require_once "lib/Swift.php"; require_once "lib/Swift/Message.php"; require_once "lib/Swift/Connection.php"; require_once "lib/Swift/Message/Attachment.php"; //require_once "lib/Swift/Connection/Multi.php"; //require_once "lib/Swift/Connection/SMTP.php"; require_once "lib/Swift/Connection/Sendmail.php"; $swift=& new Swift_Connection_Sendmail("localhost"); $message =& new Swift_Message("My subject", "sdfsdf"); $swift->send($message, "xxx@yahoo.com", "esther@gmail.com"); echo "Sent to $sent recipients";
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Have I got an error in my docs or something? Everyone seems to be making this mistake lately 
You *always* need to create an instance of Swift otherwise there's nothing controlling the connection
The connections are just that -- connections.
Code: Select all
$swift =& new Swift($sendmail);