Swiftmailer and shell access

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!

Moderator: General Moderators

Post Reply
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Swiftmailer and shell access

Post by matthijs »

I'm trying to work with the Swiftmailer class. However, as documented, one has to try to telnet to the smtp server first to see if that's working, I've never telnetted before (is that a good word?), but I've opened the command prompt on my windows box and after entering telnet smtp.mydomain.com 25 it seemed to work (trying to connect to ...)

However, I cannot make a connection. Looking up my hosts' info, it says:
"Telnet and Secure Shell are not switched on because of security reasons. To protect your data no one is allowed shell access."

Does that mean I can't use Swiftmailer?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

I don't know, but if your telnet'ing or SSH'ing then I can highly recommend PuTTY, instead of command prompt.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

"hosts' info"? Do you mean your hosting company or what?
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Weirdan: yes, I mean the info I read on the website of my hosting company. Apparently they do not allow telnet access. So I was wondering if that means if I cannot use swiftmailer.

jayshields: thanks for the link. I'll take a look at putty.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

matthijs wrote:Weirdan: yes, I mean the info I read on the website of my hosting company. Apparently they do not allow telnet access. So I was wondering if that means if I cannot use swiftmailer.

jayshields: thanks for the link. I'll take a look at putty.
No it doesn't mean you can't use Swift ;) It just means you can't check clearly if the two servers can speak to each other. More than likely it will just work if the SMTP server is active. Telnet from your own PC as a quick check if you're unsure if the actual SMTP details are correct.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

It seems I'm just not allowed to telnet my server for security reasons. Well, it's a cheap shared host so you can't expect too much I guess.

I did manage to get swiftmailer send a mail, so the smtp setting is correct. Next problem is that only mailing to an email address from the domain itself is allowed (i.e. info@mydomain.com on mydomain.com). Every other address results in
[response] => 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

Using mail() or other mail classes (like phpmailer) I can email those other email addresses. So that's very strange.

One quick question: with smtp details one means just smtp.mydomain.com, isn't it?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

matthijs wrote:One quick question: with smtp details one means just smtp.mydomain.com, isn't it?
(Assumes the email is I got via the website from your good self too :) )

The SMTP server could be anything.... if you're specifiying it like you are then maybe you're getting these relaying denied messages because the server you're sending through is not the same as if you use sendmail (as in, PHPMailer, mail() ).

Try using the sendmail connection instead or (possibly) put localhost as the server to connect to ;)
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Yes indeed, that was my email :)

I know that the smtp details I now use are correct. Only problem is that sending is only allowed to my own domain, not to any other address.

I have also contacted my host to ask why this happens. My own knowledge in this area is lacking severely, unfortunately :cry:
Post Reply