Download the PHP package mouf/utils.mailer.smtp-mail-service without Composer
On this page you can find all versions of the php package mouf/utils.mailer.smtp-mail-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mouf/utils.mailer.smtp-mail-service
More information about mouf/utils.mailer.smtp-mail-service
Files in mouf/utils.mailer.smtp-mail-service
Package utils.mailer.smtp-mail-service
Short Description This package contains a mailer that uses a SMTP server to send mail. The package is a wrapper around the Zend_Mail class of the Zend framework.
License MIT
Homepage https://github.com/thecodingmachine/utils.mailer.smtp-mail-service
Informations about the package utils.mailer.smtp-mail-service
The SmtpMailService
The SmtpMailService
is used to send mails using a SMTP mail server.
The SmtpMailService
is designed to be simple to use. Behind the scene, the SmtpMailService
is using the more complex (and more powerful) ZendFramework 2 mail service.
Install
This package is part of the Mouf PHP framework. As such, it comes with a nice graphical installer.
You can configure the settings to connect to your SMTP server.
There is one compulsory parameter: host, which is the address of the server.
By default, on Linux systems, it is likely you will use the local mail server (host=127.0.0.1). You will have a "sendmail" or "postfix" server installed on your machine. If you are performing your developments on a Windows machine, it is quite likely that you will not have an SMTP server on your machine. You will therefore have to use a remote server. To access the remote server, you will certainly have to use login/passwords, etc...
When this package is installed, it will create a default "smtpMailService" and put in this instance all the parameters you have provided.
After installation, you will see that a number of constants have been added to your config.php
file.
When deploying on other servers, you can of course change those constants to adapt to the settings of the server.
Tip: using your gmail account to send mails
In a development environment, it can be useful to use you gmail account. Here are the settings:
- host => 'smtp.gmail.com'
- ssl => 'tls'
- port => 587
- auth => 'login'
- username => Your gmail mail address
- password => Your password
Example use
Below is a sample code you can use to send a mail.
To learn more about how to send mails, refer to the Introduction to Mouf's mail architecture.
All versions of utils.mailer.smtp-mail-service with dependencies
mouf/utils.common.mouf-helpers Version ~2.0
mouf/utils.mailer.mail-interface Version ~2.0
mouf/utils.log.errorlog_logger Version ~2.0
zendframework/zend-mail Version ~2.1@stable
zendframework/zend-eventmanager Version ~2.1@stable
zendframework/zend-servicemanager Version ~2.1@stable
zendframework/zend-validator Version ~2.1@stable