Cannot Connect

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
ksorbo
Forum Newbie
Posts: 1
Joined: Fri Jan 26, 2007 7:57 pm

Cannot Connect

Post by ksorbo »

Really looking forward to using Swiftmailer, but I cannot get connected to my SMTP server. I have read most of the threads about this problem. When I couldn't create a swift object I tried the following function:

Code: Select all

function testsock() {
		$sock  = fsockopen("mail.myserversname.com", 25, $errno, $errstr, 10);
		var_dump($sock);
		echo "<br />Error number: $errno";
		echo "<br />Error message: $errstr";	
	}
This results in the following:

Code: Select all

A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to mail.myserversname.com:25

Filename: controllers/contacts.php

Line Number: 23

bool(false)
Error number: 111
Error message: Connection refused
I know my server uses pop login authentication. I am able to send mail regularly with all my email clients

Any suggestions?

Keith
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Ask your host ;) Either your host are blocking the outgoing connection or the remote server is rfusing your connection. As you can see from your test, it's not related to Swift, it's a server config issue.
Post Reply