views:

40

answers:

2

I know that default mail transport could be set in bootstrap file but how to do it in app.ini file? Basically I want to use smtp transport on local windows system and regular mail transport on production server.

Edit: I'm already using these settings in app.ini .

Thanks.

A: 

you may looking for :

 resources.mail.transport.register = true ; True by default

full example : if you were in production you would use the first transport and in the development you would use development , pretty easy isn't

[production]
resources.mail.transport.type = smtp
resources.mail.transport.host = "smtp.example.com"
resources.mail.transport.auth = login
resources.mail.transport.username = myUsername
resources.mail.transport.password = myPassword
resources.mail.transport.register = true ; True by default

resources.mail.defaultFrom.email = [email protected]
resources.mail.defaultFrom.name = "John Doe"
resources.mail.defaultReplyTo.email = [email protected]
resources.mail.defaultReplyTo.name = "Jane Doe"


[development]
resources.mail.transport.type = smtp
resources.mail.transport.host = "smtp2.example.com"
resources.mail.transport.auth = login2
resources.mail.transport.username = myUsername
resources.mail.transport.password = myPassword
resources.mail.transport.register = true ; True by default

resources.mail.defaultFrom.email = [email protected]
resources.mail.defaultFrom.name = "John Doe"
resources.mail.defaultReplyTo.email = [email protected]
resources.mail.defaultReplyTo.name = "Jane Doe"

source : http://framework.zend.com/manual/en/zend.application.available-resources.html

tawfekov
@tawfekov: This is exactly the source I've mentioned in 'Edit'. I think 'register' is not same as setting default. "When instantiating a transport, it's registered automatically to Zend_Mail. Though, by setting the transport.register directive to FALSE, this behaviour does no more occur. "
understack
@understack , you could notice its result once you have multiple transports
tawfekov
+1  A: 

If your production server is *nix

[production]
resources.mail.transport.type = sendmail
[development : production]
resources.mail.transport.type = smtp
resources.mail.transport.host = smtp.example.com
Maxence