GSTAR
(Omzy83)
November 29, 2010, 1:50am
1
I am using the SwiftMailer extension (http://www.yiiframework.com/extension/mail ) and I have set it up as follows:
'mail'=>array(
'class'=>'ext.yii-mail.YiiMail',
'transportType'=>'smtp',
'transportOptions'=>array(
'host'=>'mail.mysmtp.com',
'username'=>'me@mycompany.co.uk',
'password'=>'password',
'port'=>25,
),
'viewPath'=>'application.views.mail',
'logging'=>false,
'dryRun'=>false,
),
But for some reason I am receiving the following error message on the page:
Error 500
fsockopen() [<a href=‘function.fsockopen’>function.fsockopen</a>]: unable to connect to mail.mysmtp.com:25 (Permission denied)
It may well be a server error but I can’t figure out what it is…
jacmoe
(Jacob Moena)
November 29, 2010, 11:22am
2
What??
Do you expect it to work when you left the defaults as-is?
Unless you really have a smtp host called mail.mysmtp.com and a password which matches me@mycompany.com , then it will definitely fail.
First, try setting the transport type to ‘php’:
'transportType' => 'php',
And remove/comment out the transportOptions.
GSTAR
(Omzy83)
November 29, 2010, 11:27am
3
No man, I changed those values in my post so that I don’t expose my mail server/account information!
I will try with PHP now.
jacmoe
(Jacob Moena)
November 29, 2010, 11:30am
4
That was clever.
Then it definitely works. But the mail server is rejecting you.
Maybe the wrong port?
GSTAR
(Omzy83)
November 29, 2010, 1:22pm
5
The problem was on the hosting server, which had a firewall blocking external hosts, or something like that. They have added the IP addresses to their allowed list and it’s working fine now.
it is not working for transport type php…please help