Created
September 5, 2013 08:09
-
-
Save vgrish/6447314 to your computer and use it in GitHub Desktop.
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
<?php | |
$uri = $_SERVER['REDIRECT_URL']; | |
$ref = $_SERVER['HTTP_REFERER']; | |
$confirmationFields['uri'] = $uri; | |
$confirmationFields['ref'] = $ref; | |
$uri.="\n"; | |
$file=fopen("uri.txt", "a"); | |
fwrite ($file,"http://".$_SERVER['SERVER_NAME'].$uri); | |
fclose($file); | |
$message = $modx->getChunk('tpl.redirect', $confirmationFields); | |
$modx->getService('mail', 'mail.modPHPMailer'); | |
$modx->mail->set(modMail::MAIL_BODY,$message); | |
$modx->mail->set(modMail::MAIL_FROM,'me@example.org'); | |
$modx->mail->set(modMail::MAIL_FROM_NAME,'Сайт name.ru'); | |
$modx->mail->set(modMail::MAIL_SUBJECT,'неправильный адрес'); | |
$modx->mail->address('to','vovanblya@mail.ru'); | |
$modx->mail->setHTML(true); | |
if (!$modx->mail->send()) { | |
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo); | |
} | |
$modx->mail->reset(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment