You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					45 lines
				
				1.3 KiB
			
		
		
			
		
	
	
					45 lines
				
				1.3 KiB
			| 
											12 years ago
										 | <?php
 | ||
|  | /**
 | ||
|  |  * @link http://www.yiiframework.com/
 | ||
|  |  * @copyright Copyright (c) 2008 Yii Software LLC
 | ||
|  |  * @license http://www.yiiframework.com/license/
 | ||
|  |  */
 | ||
|  | 
 | ||
| 
											12 years ago
										 | namespace yii\mail;
 | ||
| 
											12 years ago
										 | 
 | ||
| 
											12 years ago
										 | use yii\swiftmailer\Message as SwiftMessage;
 | ||
| 
											12 years ago
										 | 
 | ||
|  | /**
 | ||
|  |  * Message provides the email message sending functionality.
 | ||
|  |  *
 | ||
|  |  * Usage:
 | ||
|  |  * ~~~
 | ||
|  |  * $email = new Message();
 | ||
|  |  * $email->from = 'sender@domain.com';
 | ||
|  |  * $email->to = 'receiver@domain.com';
 | ||
|  |  * $email->subject = 'Message Subject';
 | ||
|  |  * $email->text = 'Message Content';
 | ||
|  |  * $email->send();
 | ||
|  |  * ~~~
 | ||
|  |  *
 | ||
| 
											12 years ago
										 |  * You can use message object to render view, which can be used to compose the message content:
 | ||
|  |  * ~~~
 | ||
|  |  * $email = new Message();
 | ||
|  |  * $email->from = $contactForm->email;
 | ||
|  |  * $email->to = 'admin@domain.com';
 | ||
|  |  * $email->subject = $email->render('contact/subject', ['form' => $contactForm]);
 | ||
|  |  * $email->addHtml($email->render('contact/html', ['form' => $contactForm]));
 | ||
|  |  * $email->addText($email->render('contact/text', ['form' => $contactForm]));
 | ||
|  |  * $email->send();
 | ||
|  |  * ~~~
 | ||
|  |  *
 | ||
| 
											12 years ago
										 |  * This particular class uses 'SwiftMailer' library to perform the message sending.
 | ||
|  |  * Note: you can replace usage of this class by your own one, using [[Yii::$classMap]]:
 | ||
|  |  * ~~~
 | ||
| 
											12 years ago
										 |  * Yii::$classMap['yii\mail\Message'] = '/path/to/my/email/Message.php'
 | ||
| 
											12 years ago
										 |  * ~~~
 | ||
|  |  *
 | ||
|  |  * @author Paul Klimov <klimov.paul@gmail.com>
 | ||
|  |  * @since 2.0
 | ||
|  |  */
 | ||
|  | class Message extends SwiftMessage {}
 |