-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
###$modx->sendmail() | ||
Method used for send mails by API (available since 1.0.12). Works with settings, sending emails using `mail()` or SMTP according to the specified settings in the manager panel. | ||
Usage: | ||
|
||
####simple variant | ||
``` | ||
$param = array(); | ||
$param['from'] = "{$site_name}<{$emailsender}>"; | ||
$param['subject'] = $emailsubject; | ||
$param['body'] = $message; | ||
$param['to'] = $email; | ||
$rs = $modx->sendmail($param); | ||
``` | ||
####variant with additional settings | ||
``` | ||
$modx->loadExtension('MODxMailer'); | ||
$modx->mail->IsHTML($isHtml); | ||
$modx->mail->From = $from; | ||
$modx->mail->FromName = $fromname; | ||
$modx->mail->Subject = $subject; | ||
$modx->mail->Body = $report; | ||
AddAddressToMailer($modx->mail,"replyto",$replyto); | ||
AddAddressToMailer($modx->mail,"to",$to); | ||
AddAddressToMailer($modx->mail,"cc",$cc); | ||
AddAddressToMailer($modx->mail,"bcc",$bcc); | ||
AttachFilesToMailer($modx->mail,$attachments); | ||
if(!$modx->mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $modx->mail->ErrorInfo; | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
###$modx->sendmail() | ||
Функция отправки почты через API(доступен с версии 1.0.12), удобен тем что работает в связке с настройками тоесть отправляет почту через mail() или SMTP в зависимости от указанных настроек в панели управления. | ||
Пример использования: | ||
|
||
####простой вариант | ||
``` | ||
$param = array(); | ||
$param['from'] = "{$site_name}<{$emailsender}>"; | ||
$param['subject'] = $emailsubject; | ||
$param['body'] = $message; | ||
$param['to'] = $email; | ||
$rs = $modx->sendmail($param); | ||
``` | ||
####вариант с расширенными настройками | ||
``` | ||
$modx->loadExtension('MODxMailer'); | ||
$modx->mail->IsHTML($isHtml); | ||
$modx->mail->From = $from; | ||
$modx->mail->FromName = $fromname; | ||
$modx->mail->Subject = $subject; | ||
$modx->mail->Body = $report; | ||
AddAddressToMailer($modx->mail,"replyto",$replyto); | ||
AddAddressToMailer($modx->mail,"to",$to); | ||
AddAddressToMailer($modx->mail,"cc",$cc); | ||
AddAddressToMailer($modx->mail,"bcc",$bcc); | ||
AttachFilesToMailer($modx->mail,$attachments); | ||
if(!$modx->mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $modx->mail->ErrorInfo; | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.