This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.0 » Mailer configuration
Mailer configuration [message #16921] Thu, 30 November 2006 16:29 Go to next message
Shadow  is currently offline Shadow
Messages: 10
Registered: April 2006
Junior Member
The mailer.yml still does not work.

I have created a mailer.yml file in config directory but parameters are not used.

myapp\modules\mymodule\config\mailer.yml :

dev:
  mailer:   smtp
  hostname: smtp.mydomain.com
  
all:
  charset:      iso-8859-1
  content_type: text/html


myapp\modules\mymodule\actions\actions.class.php

public function executeSendEmail()
{ 
  $this->sendEmail('mymodule', 'sendMyEmail');
}
  
public function executeSendMyEmail()
{
  $email = new sfMail();   
  $email->initialize();
    
  $email->addAddress('myaddress');
  $email->setSubject('My subjetct');
  
  $this->mail = $email;    
}


This bug had not to be fixed ?


Shadow
Re: Mailer configuration [message #95779 is a reply to message #16921 ] Fri, 19 March 2010 11:44 Go to previous messageGo to next message
sanjay  is currently offline sanjay
Messages: 8
Registered: February 2010
Location: India
Junior Member
Hi,
If u are using sf 1.4 then try this

factories.yml

all:
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true

view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true

response:
class: sfWebResponse
param:
send_http_headers: false


mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: smtp.googlemail.com
port: 465
encryption: ssl
username: YOUR GMAIL ACCOUNT
password: YOUR PASSWORD

Please indent the factories.yml

create a function in main lib
public static function MailFunction($ssMailTo = '', $ssMailFrom = '', $ssMailSubject = '', $ssMailBody = '')

{

$oMail = sfContext::getInstance()->getMailer()->compose();

$oMail->setSubject($ssMailSubject);

$oMail->setTo($ssMailTo);

$oMail->setFrom($ssMailFrom);

$oMail->setBody($ssMailBody, 'text/html');

sfContext::getInstance()->getMailer()->send($oMail);

}
and call this function from your action.
Hope it will work for U.
Re: Mailer configuration [message #95792 is a reply to message #16921 ] Fri, 19 March 2010 13:58 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
This thread is over three years old, and the OP would have been using symfony 1.0, I should think!


Remember Palestine
Previous Topic:swf in symfony
Next Topic:logs and purging possible bug?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software