views:

652

answers:

3

I've had no need to send mails on my 2 sites hosted at the UK Fasthosts provider.
But since I've added some email features to one of my sites I've tried to send mail via the Email Component of CakePHP and it doesn't leave the server, even if the send returns success.

I've tried with plain mail() function and with the smtp option and got nowhere.

Any ideas?

+1  A: 

I am not familiar with that hosting service but I've had similar experiences with other providers. The one thing that's worked across them all is the SwiftMailer library. Check it out and see if it works for you.

http://swiftmailer.org/

JD
doh! beat me by 47 seconds.
Brent Baisley
SwiftMail was my original idea to fix it. I just wanted to know if anyone knew WTF is Fasthosts doing...
Gustavo Carreno
A: 

Check out SwitfMail (http://swiftmailer.org/). You can connect to most mail systems and send email, no local configuration or dependencies. I regular send alerts through my gmail account. It's very robust, but has a "simple" execution option if you are not trying to manage email lists.

Brent Baisley
I'm familiar with SwiftMail, but would rather want to avoid it and keep CakePHP "insides". I'm basically trying to figure out WTF is Fasthosts doing. Thanks anyway.
Gustavo Carreno
A: 

your code isnt the problem. your email server has alot of queued email. the same issue happend to me with godaddys email server. just give it a day and try again.

SarmenHB
It's been more than 2 weeks.
Gustavo Carreno
ok, open a new page with nothing on it send a simple mail with the mail function. if it sends then the server is fine. so if thats the case can you post your code?
SarmenHB
Hummm, via command line all looks fine. Will try with script on web server.
Gustavo Carreno
Damn, from a simple script, mail goes. Need to look at CakePHP's code
Gustavo Carreno