Download the PHP package cstudios/craft-smtpmailer without Composer

On this page you can find all versions of the php package cstudios/craft-smtpmailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-smtpmailer

SMTP Mailer Plugin for Craft CMS

We've built this plugin for internal use, but we've decided to make it public

SMTP Mailer provides additional options to send out mails compared to Pixel&Tonic`s Contact Form. However you have to programatically set up everything. There is no Control Panel interface for this plugin.

Make sure to carefully read the instructions before you use this plugin.

Instructions

Add these lines to your .env file

Obviously these are just placeholders, you need your own smtp configuration to make this work.

Create a _mails directory under your templates Notice the underscore > _

templates/_mails

Create a email_template_config.php file inside your config folder > config/email_template_config.php and copy the contents of this file into that

How do these templates work?

templates/_mails contains your email templates. These will be sent out to the email addresses. The files inside this directory will get the variables you will set up on the contact pages.

Example:

You have a job application form (e.g. here: templates/pages/contact.twig). You might want to get the applicants age

If you use this code:

Then you can use this variable inside your email template (That you might set up here templates/_mails/job_contact.twig) like this:

This is depends on what you've entered into your input field's name attribute. ()

Where will we send the email?

First of all, it is important to know that the email template is not just a file name but an identifier as well. So if you have a templates/_mails/job_contact.twig file, your ID for this template is job_contact

On you contact page you will need to place this row

This will tell 2 things to this plugin

Now this file is important. Here you actually refer to the functions specified in PHPmailer. You use keys to refer to the methods, and values to fill out the data. I left an example in this repo: https://raw.githubusercontent.com/cstudiossro/smtpmailer/main/email_template_config.php

How to change the subject

Put these line into your email_template_config.php file

How to use google recaptcha?

Add this line to the .env file (you will need the recaptcha secret):

Put these line into your email_template_config.php file

After that, place this line into your form

What happens if recaptcha could not authenticate the user

The page will return you to the email form, but you can retrieve the recaptcha error codes as follows:

Error codes are separated by pipe, e.g.: missing-input-secret|missing-input-response
In twig 2 and 3, you can split it with this: https://twig.symfony.com/doc/3.x/filters/split.html

List of all the possible recaptcha error codes: https://developers.google.com/recaptcha/docs/verify#error_code_reference

How to generate a contact form?

How to generate email template?

How to use sendmail (instead of SMTP)?

Go into the .env file and copy the delivery_protocol line here:

How to send static files:

In your email_template_config.php file:

The @webroot alias points towards your /web folder

@webroot provides an absolute file system path, while @web only gives you a relative web path

How to send files from a form?

How do I send an autoreply email?

Autoreply will go to the person who filled out your contact form

Paste these lines into your email_template_config.php, inside the template you want to have autoreply

On the contact form:


All versions of craft-smtpmailer with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.0.0-alpha
phpmailer/phpmailer Version ^6.4
google/recaptcha Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cstudios/craft-smtpmailer contains the following files

Loading the files please wait ....