sfMailer -> ignoring my factories.yml?

Discussion relating to version 1.3.x and 1.4.x

sfMailer -> ignoring my factories.yml?

Postby Hansi » Sun Mar 04, 2012 12:48 pm

Hi!

I'm trying to send mails via task, that i would like to run per batch. In the task-execute()-function, i tried the follwing:

$mailer = $this->getMailer();
$message = $mailer->compose()
->setFrom(sfConfig::get('app_emailadresse'))
->setTo('mail@supermail.com')
->setSubject('Subject')
->setBody($content);

$this->getMailer()->send($message);

(i also tried many other versions e.g. with sfContext::getInstance()->getMailer(), but then i got "the default context does not exist)

In factories.yml, I added the following:
all:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: mycustom.smtp.com //of course, i set the data of my provider ;)
port: 587
encryption: ssl
username: myusername //of course, i set the data of my provider ;)
password: mypassword //of course, i set the data of my provider ;)

But on the command-line, after running my task, i always got "Connection could not be established with localhost"
This is confusing, because in the factory.yml i told the mailer to use MY settings, haven't I ??
Of course i cleared cache etc. and i read different examples and tutorials but still i don't got it :(

Could someone help me?
Hansi
Junior Member
 
Posts: 5
Joined: Sun Feb 05, 2012 12:39 pm

Re: sfMailer -> ignoring my factories.yml?

Postby CharlieM » Fri Aug 24, 2012 2:17 am

Hi Hansi,

did you find a solution for this problem?
I am facing the same problem at the moment.


Thx!
CharlieM
Junior Member
 
Posts: 7
Joined: Wed Oct 06, 2010 1:30 pm


Return to symfony 1.3 and 1.4

Who is online

Users browsing this forum: No registered users and 8 guests