Code: Select all
require_once "swift/lib/swift/Swift.php";
require_once "swift/lib/Swift/Connection/SMTP.php";
$swift =& new Swift(new Swift_Connection_SMTP("server.tld", 25));
$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";
}which results in this error
Warning: main(swift/lib/swift/Swift.php) [function.main]: failed to open stream: No such file or directory in /home/pinehead/www/dennis/new/send.php on line 7
Fatal error: main() [function.require]: Failed opening required 'swift/lib/swift/Swift.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /home/pinehead/www/dennis/new/send.php on line 7
So what I did was i found swift.php inside of lib/swift.php and changed it to that and i got this error message
atal error: Uncaught exception 'Swift_Connection_Exception' with message 'The SMTP connection failed to start [server.tld:25]: fsockopen returned Error Number -1220158082 and Error String ''' in /home/pinehead/www/dennis/new/swift/lib/Swift/Connection/SMTP.php:291 Stack trace: #0 /home/pinehead/www/dennis/new/swift/lib/Swift.php(220): Swift_Connection_SMTP->start() #1 /home/pinehead/www/dennis/new/swift/lib/Swift.php(97): Swift->connect() #2 /home/pinehead/www/dennis/new/send.php(10): Swift->__construct(Object(Swift_Connection_SMTP)) #3 {main} thrown in /home/pinehead/www/dennis/new/swift/lib/Swift/Connection/SMTP.php on line 291
Thanks.
Anthony