Download the PHP package samsher-bentray/yii2-mailer without Composer

On this page you can find all versions of the php package samsher-bentray/yii2-mailer. 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 yii2-mailer

Mailer

PHP and SMTP Mailer in Yii2 with dynamic configuration

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Configuration

Once the extension is installed, add following code to your application configuration :

Usage

Once the extension is installed, simply use it in your code by using these codes as following way in the controller:


public function actionCreate()

    {

        $model = new Email();

        if ($model->load(Yii::$app->request->post())) {

                /*Starting configuration for smtp or other type*/

                Yii::$app->email->setMailType('SMTP');//aeruement is either 'SMTP' or 'PHPMAIL'

                //Passing arguement for Host setting
                Yii::$app->email->setHost('smtp.gmail.com');// aeruement is 'smtp.gmail.com' for gmail

                //Passing arguement for Username setting
                Yii::$app->email->setUname('some email');

                //Passing arguement for Password setting
                Yii::$app->email->setPassd('password');

                //Passing arguement for Encryption Type setting
                Yii::$app->email->setEncType('ssl');//encryption type must either be 'ssl' or 'tls'

                //Passing arguement for Port setting
                Yii::$app->email->setServerPort('465'); port of gmail server is '465' for 'SSL' and '587' for 'TLS'

                /*Ending configuration for smtp or other type*/
                Yii::$app->email->configSet();//note that email setting is completed only after executing this function

                /*Starting configuration for php mail*/

                //Passing arguement to set from
                Yii::$app->email->setFrom('some email');

                //Passing arguement to set Reply To
                Yii::$app->email->setReplyTo('some email');

                //Passing arguement to set Return Path
                Yii::$app->email->setReturnPath('some email');

                $to = $model->to;

                $subject = $model->subject;

                $message_body = $model->text_body;

                $cc = $model->cc;

                $bcc = $model->bcc;

                /*Assigning the files for attachments*/

                $attachment = UploadedFile::getInstances($model,'attachment');

                Yii::$app->email->SaveAttach($attachment);

                // Syntax Yii::$app->email->SendMail($from,$to,$subject,$message_body,$cc,$bcc,$attachment);
                // It is important that default mail type is PHP mail
                // If we want to use PHP mail ,we can call only the function 
                // "Yii::$app->email->SendMail($from,$to,$subject,$message_body,$cc,$bcc,$attachment);"
                // If we want to use Smtp mail or other type, we can call the function
                // "Yii::$app->email->SendMail($from,$to,$subject,$message_body,$cc,$bcc,$attachment);"
                // only after the six setting for and running Yii::$app->email->configSet();

               if (Yii::$app->email->SendMail($from,$to,$subject,$message_body,$cc,$bcc,$attachment)){

                    //deleting the attachment
                    Yii::$app->email->DeleteAttach($attachments);
                    Yii::$app->session->setFlash('success','Email sent.'); //for for wrong event.
                    return $this->redirect(['create']);
                }
                else {
                    Yii::$app->session->setFlash('danger','Email send not success.'); //for for wrong event.
                    return $this->redirect(['create']);
                }
        }

        else{

            return $this->render('create', [

                'model' => $model,

            ]);

        }

    }

All versions of yii2-mailer with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
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 samsher-bentray/yii2-mailer contains the following files

Loading the files please wait ....