{"id":18929451,"url":"https://github.com/thecodingmachine/utils.mailer.smtp-mail-service","last_synced_at":"2026-03-16T14:30:18.321Z","repository":{"id":57020167,"uuid":"10031481","full_name":"thecodingmachine/utils.mailer.smtp-mail-service","owner":"thecodingmachine","description":"This package contains a mailer that uses a SMTP server to send mail. \tThe package is a wrapper around the Zend_Mail class of the Zend framework.","archived":false,"fork":false,"pushed_at":"2018-02-28T11:35:12.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"2.0","last_synced_at":"2025-02-16T12:30:31.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-13T12:47:21.000Z","updated_at":"2014-03-06T11:09:03.000Z","dependencies_parsed_at":"2022-08-22T20:31:10.850Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/utils.mailer.smtp-mail-service","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Futils.mailer.smtp-mail-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Futils.mailer.smtp-mail-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Futils.mailer.smtp-mail-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Futils.mailer.smtp-mail-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/utils.mailer.smtp-mail-service/tar.gz/refs/heads/2.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927823,"owners_count":19719835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:32:51.088Z","updated_at":"2026-03-16T14:30:18.268Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"The SmtpMailService\n===================\n\nThe `SmtpMailService` is used to send mails using a SMTP mail server.\n\nThe `SmtpMailService` is designed to be simple to use. Behind the scene, the \u003ccode\u003eSmtpMailService\u003c/code\u003e\nis using the more complex (and more powerful) ZendFramework 2 mail service.\n\nInstall\n-------\nThis package is part of the [Mouf PHP framework](http://mouf-php.com). As such, it comes with a nice graphical installer.\n\n![Install screen](doc/images/smtp_install.png)\n\nYou can configure the settings to connect to your SMTP server.\n\nThere is one compulsory parameter: \u003cb\u003ehost\u003c/b\u003e, which is the address of the server.\n\nBy 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\non your machine.\nIf 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 \ntherefore have to use a remote server. To access the remote server, you will certainly have to use login/passwords, etc...\n\nWhen this package is installed, it will create a default \"smtpMailService\" and put in this instance all the parameters you have provided.\n\n\u003cdiv class=\"alert alert-info\"\u003eNote: nothing prevents you from creating several instances of the SmtpMailService class\nwith different parameters (in the rare case you have an application that needs to connect to several SMTP servers).\u003c/div\u003e\n\nAfter installation, you will see that a number of constants have been added to your `config.php` file.\nWhen deploying on other servers, you can of course change those constants to adapt to the settings of the server.\n\nTip: using your gmail account to send mails\n-------------------------------------------\n\nIn a development environment, it can be useful to use you gmail account. Here are the settings:\n\n- host =\u0026gt; 'smtp.gmail.com'\n- ssl =\u0026gt; 'tls'\n- port =\u0026gt; 587\n- auth =\u0026gt; 'login'\n- username =\u003e \u003cem\u003eYour gmail mail address\u003c/em\u003e\n- password =\u003e \u003cem\u003eYour password\u003c/em\u003e\n\nExample use\n-----------\n\nBelow is a sample code you can use to send a mail.\n\n```php\nuse Mouf\\Utils\\Mailer\\Mail;\nuse Mouf\\Utils\\Mailer\\SmtpMailService;\n\n// First, let's create the mail object\n$mail = new Mail();\n$mail-\u003esetTitle(\"My mail\");\n$mail-\u003esetBodyText(\"This is my mail!\");\n$mail-\u003esetBodyHtml(\"This is my \u0026lt;b\u0026gt;mail\u0026lt;/b\u0026gt;!\");\n$mail-\u003esetFrom(new MailAddress(\"my@server.com\", \"Server\"));\n$mail-\u003eaddToRecipient(new MailAddress(\"david@email.com\", \"David\"));\n\n// Let's get the instance of the service\n$mailService = Mouf::getSmtpMailService();\n\n// Finally, we send the mail\n$mailService-\u003esend($mail);\n```\n\nTo learn more about how to send mails, refer to the [Introduction to Mouf's mail architecture](http://mouf-php.com/packages/mouf/utils.mailer.mail-interface/README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Futils.mailer.smtp-mail-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Futils.mailer.smtp-mail-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Futils.mailer.smtp-mail-service/lists"}