pceuropa/yii2-email

Widget help send email. Have validate input email.

Installs: 1 781

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:yii2-extension

1.2.2 2018-08-11 17:55 UTC

This package is auto-updated.

Last update: 2024-12-12 09:07:02 UTC


README

This extension help send emails. In this version (1.0.1) only text messsage.

Installation

The preferred way to install this extension is through composer.

Either run

composer require pceuropa/yii2-email "*"

or add

"pceuropa/yii2-email": "*"

to the require section of your composer.json file.

Configuration

Yii2 config file:

'components' => [
'mailer' => [
			'class' => 'yii\swiftmailer\Mailer',
			'viewPath' => '@common/mail',    // basic Yii2: @app/mail
			'useFileTransport' => false,
			'transport' => [
				'class' => 'Swift_SmtpTransport',
				'host' => 'smtp.gmail.com',
				'username' => 'info@gmail.com',
				'password' => 'password',
				'port' => '587',		 // or 465
				'encryption' => 'tls',   // or ssl
			]
    ],
]

Usage

Once the extension is installed, simply use it in your code by :

use pceuropa\email\Send;

Send::widget([
		'from' => 'info@pceuropa.net',
		'to' => 'info@destiny.pl',
		'subject' => 'subject email',
		'textBody' => 'Hello Lorem Ipsum. Bye',
	]);