Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework: How to set default mail transport in configuration file?

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.

like image 737
understack Avatar asked Dec 21 '22 22:12

understack


2 Answers

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
like image 141
Maxence Avatar answered Mar 22 '23 23:03

Maxence


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/1.12/en/zend.application.available-resources.html

like image 21
tawfekov Avatar answered Mar 22 '23 23:03

tawfekov