PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have downloaded the latest swiftmailer and installed it. I have a simple test script with the following:
The mailer failed to connect. Errors:
Array
(
[0] => Array
(
[num] => 0
[time] => 0.80211200 1159192904
[message] => Connection to the given MTA failed. The Connection Interface said: Connection timed out
)
[1] => Array
(
[num] => 0
[time] => 0.83594500 1159192904
[message] => The MTA doesn't support any of Swift's loaded authentication mechanisms
)
)
Log:
Array
(
)
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
PHP Version? Swift Version? Does PHP have TLS support? (OpenSSL and also TLS as a registered stream in phpinfo())
If you have moved any of the files out of the original directory structure (i.e. the one for authentication) then they cannot be lazy-loaded so you need to include them manually? In other words, make sure the directory stays like it was when you downloaded it (apart from maybe renaming the parent folder).
Well get you up and running Provided your PHP is configured to use TLS. Sadly PHP4 has absolutely no way of checking this internally.
Hmm... can't really see if TLS support is included from that list. I see OpenSSL but PHP4 doesn't provide the breakdown of exactly what's there sadly. Usually you'd get an encryption error though so I imagine that's not the issue. Does it work on other servers? Some shared hosts block outgoing traffic in most ports. TLS is using port 465 here.
A quick test would be to run a service on port 465 at your own PC (maybe even just a web service like apache) and then try using fsockopen() to connect to it from the server you're using Swift on. If that fails it's out of my hands but if it works I'd be swaying more towards a TLS issue.
Make sure error reporting is on at least E_ALL by the way. It makes my debugging a heap easier.
I have a home web server set up. So I tried contacting it via swift on the server I'm having issues with but I get the exact same errors. I tried several of my outgoing severs (verizon, my personal one, gmail) and nothing works TLS or not. (So, maybe its not a tls problem??...)
I can send email via my home server and swift through any outgoing except gmail (tls). I get the same error except that it says "Conncection to the given MTA failed. The Connection Interface said: Operation now in progress."
On the server I'm having issues with, I can send mail via smtp via phpmailer so at least port 25 is open. I know in my clients, google says to send mail port 25 via tls and it works. But that won't work in this case either.
Is it possble that my host has something blocked like the function fsocketopen?
Please forgive my ignorance, but how to I set error logging to E_ALL?
haty83 wrote:I have a home web server set up. So I tried contacting it via swift on the server I'm having issues with but I get the exact same errors. I tried several of my outgoing severs (verizon, my personal one, gmail) and nothing works TLS or not. (So, maybe its not a tls problem??...)
I can send email via my home server and swift through any outgoing except gmail (tls). I get the same error except that it says "Conncection to the given MTA failed. The Connection Interface said: Operation now in progress."
On the server I'm having issues with, I can send mail via smtp via phpmailer so at least port 25 is open. I know in my clients, google says to send mail port 25 via tls and it works. But that won't work in this case either.
Is it possble that my host has something blocked like the function fsocketopen?
Please forgive my ignorance, but how to I set error logging to E_ALL?
The operation now in progress issue is a known PHP bug that was (apparently) corrected. It's somewhere in the archives of the bug tracker.
Sounds like your host are blocking outgoing traffic except for port 80 stuff. Who's your host? If it's one of the bigger ones I may already be aware of it.
Note: PHPMailer uses mail() by default. Swift offers a NativeMail connection in the latest release.
For error reporting to be on E_ALL it's as easy as:
I added "error_reporting(E_ALL);" to the top of the page but I got the same error with no extra output. How is it suppose to be used? I did some web searching but didn't quite grasp it.
I'll contact my host and see what they say.
I guess there is nothing else I can do at this point eh?
Having error_reporting(E_ALL) may or may not have changed the way the script runs depending upon the configuration in php.ini and also if there were any notices etc generated in the first place. Sounds like there's no issues with the code.
If you get back to me after contacting your host I'll pursue this further. Until then I can't really see what would cause it apart from network restrictions
Thanks for all your help! I've sent in a support ticket asking a few questions about ports and whatnot. It usually takes a day or two for them to reply. As soon as I hear back from them, I'll post back.
On Mon, 25 Sep 2006 11:40:16 -0600, harty83@gmail.com wrote:
> IP: 70.110.15.152
>
> Hello,
>
> I am trying to setup a program called swiftmailer and it is not working. I'm not asking for help concerning the program but rather wanted to ask a few questions about your setup that could be affecting the program.
>
> 1) Do you have any of the ports 25, 465, or 587 blocked?
>
> 2) Does php have tls support configured?
>
> 3) Would there be any reason why the function fsocketopen() would not work on your server?
>
> Thanks!
> Alan
Most ports are blocked unless you purchase a dedficated ip address. You can use the fsocketopen function. we don't have tls support.
I guess that means I am out of luck eh? No way to get around it?
haty83 wrote:I guess that means I am out of luck eh? No way to get around it?
Alan
You could run your own mail server on port 80 I think. Just a guess. How about using the NativeMail connection which is just a callback for PHP's mail() function?
The problem I ran into which prompt me to look into swiftmailer to begin with is that my host has a 50 email per hour limit for php mail() or through their mail servers. So I was going to utilize gmail's servers to send emails because we have a mailing list with 125 emails. If we need to send 2 messages to the list, it will take over 6 hours for everyone to receive the message.
I do have a personal mail server set up that I am using at the moment. But I wanted something that wasn't depended on my home internet connection and my maintanence.
To get a dedicated IP address with my host is only 30 bucks more a year. I've replied to their response to see if I purchase a dedicated IP, could I have tls support added. I have not heard back from them yet.