Configuration Error

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
Apryle
Forum Newbie
Posts: 7
Joined: Wed Jul 18, 2007 12:54 pm

Configuration Error

Post by Apryle »

I uploaded the lib folder as-is, in an accessible folder for the file to access the required files. I tried to send a simple email:

Code: Select all

<?php
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
 
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.your-host.tld"));
 
//Create the message
$message =& new Swift_Message("My subject", "My body");
 
//Now check if Swift actually sends it
if ($swift->send($message, "apryle@allyourssolutions.com", "climberapryle@yahoo.com")) echo "Sent";
else echo "Failed";
?>
And I receive:

Code: Select all

Fatal error:
Uncaught Error of type [swift_connectionexception] with message [The SMTP connection failed to start [smtp.your-host.tld:25]: fsockopen returned Error Number 0 and Error String 'The operation completed successfully. ']
@0 swift::swift() in C:\Domains\epbor.com\wwwroot\membersonly\processemailer.php on line 8
@1 swift::connect() in C:\Domains\epbor.com\wwwroot\membersonly\lib\Swift.php on line 109
in C:\Domains\epbor.com\wwwroot\membersonly\lib\Swift\Errors.php on line 99

My web host provides SMTP Server (with authentication). Any help is greatly appreciated for this php newbie.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Did you set the SMTP server to your real SMTP server, not "smtp.your-host.tld"?
Apryle
Forum Newbie
Posts: 7
Joined: Wed Jul 18, 2007 12:54 pm

Post by Apryle »

No. I didn't see that in the Install instructions and could not find the file in which to change anything. Could you tell me which file I need to go into? Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's in the very middle of the code you posted above.
Post Reply