Returns false if it cannot load the language file.
The default language is English.
/** * Inner mailer initialization from set variables * * @return void */ protected function initMailFromSet() { $this->mail->setLanguage($this->get('langLocale'), $this->get('langPath')); $this->mail->CharSet = $this->get('charset'); $this->mail->From = $this->get('from'); $this->mail->FromName = $this->get('fromName') ?: $this->get('from'); $this->mail->Sender = $this->get('from'); $this->mail->clearAllRecipients(); $this->mail->clearAttachments(); $this->mail->clearCustomHeaders(); $emails = explode(static::MAIL_SEPARATOR, $this->get('to')); foreach ($emails as $email) { $this->mail->addAddress($email); } $this->mail->Subject = $this->get('subject'); $this->mail->AltBody = $this->createAltBody($this->get('body')); $this->mail->Body = $this->get('body'); // add custom headers foreach ($this->get('customHeaders') as $header) { $this->mail->addCustomHeader($header); } if (is_array($this->get('images'))) { foreach ($this->get('images') as $image) { // Append to $attachment array $this->mail->addEmbeddedImage($image['path'], $image['name'] . '@mail.lc', $image['name'], 'base64', $image['mime']); } } }
/** * Test language files for missing and excess translations * All languages are compared with English * @group languages */ public function testTranslations() { $this->Mail->setLanguage('en'); $definedStrings = $this->Mail->getTranslations(); $err = ''; foreach (new DirectoryIterator('../language') as $fileInfo) { if ($fileInfo->isDot()) { continue; } $matches = array(); //Only look at language files, ignore anything else in there if (preg_match('/^phpmailer\\.lang-([a-z_]{2,})\\.php$/', $fileInfo->getFilename(), $matches)) { $lang = $matches[1]; //Extract language code $PHPMAILER_LANG = array(); //Language strings get put in here include $fileInfo->getPathname(); //Get language strings $missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG)); $extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings)); if (!empty($missing)) { $err .= "\nMissing translations in {$lang}: " . implode(', ', $missing); } if (!empty($extra)) { $err .= "\nExtra translations in {$lang}: " . implode(', ', $extra); } } } $this->assertEmpty($err, $err); }
/** * Class constructor * * @param boolean $exceptions PHPMailer should throw external exceptions? [Optional] */ public function __construct($exceptions = TRUE) { require_once Kohana::find_file('vendor/PHPMailer', 'PHPMailerAutoload'); // Create phpmailer object $this->_mail = new PHPMailer($exceptions); // Set some defaults $this->_mail->setFrom(Config::get('site.site_email', '*****@*****.**'), Template::getSiteName()); $this->_mail->WordWrap = 70; $this->_mail->CharSet = Kohana::$charset; $this->_mail->XMailer = Gleez::getVersion(FALSE, TRUE); $this->_mail->setLanguage(I18n::$lang); $this->_mail->Debugoutput = 'error_log'; }
static function email($assunto, $msg, $remetente, $nomeRemetente, $destino, $nomeDestino) { $path = VENDOR . "phpmailer" . DS . "phpmailer" . DS; require_once $path . 'PHPMailerAutoload.php'; $mail = new \PHPMailer(); $mail->IsSMTP(); $mail->setLanguage('br'); $mail->SMTPAuth = true; $mail->Host = HOST_EMAIL; $mail->Username = USER_EMAIL; $mail->Password = PASS_EMAIL; $mail->From = $remetente; //remetente $mail->FromName = utf8_decode($nomeRemetente); //remetente nome $mail->AddReplyTo($remetente, utf8_decode($nomeRemetente)); $mail->IsHTML(true); $mail->Subject = utf8_decode($assunto); //assunto $mail->Body = utf8_decode($msg); //mensagem $mail->AddAddress($destino, utf8_decode($nomeDestino)); //email e nome destino return $mail->Send(); }
function smtpMailer($to, $from, $from_name, $subject, $body) { $mail = new \PHPMailer(); // Cree un nouvel objet PHPMailer $mail->IsSMTP(); // active SMTP $mail->IsHTML(true); $mail->CharSet = "utf-8"; $mail->SMTPDebug = 0; // debogage: 1 = Erreurs et messages, 2 = messages seulement $mail->SMTPAuth = true; // Authentification SMTP active $mail->SMTPSecure = 'ssl'; // Gmail REQUIERT Le transfert securise $mail->Host = 'smtp.gmail.com'; $mail->Port = 465; $mail->Username = GMailUSER; $mail->Password = GMailPWD; $mail->SetFrom($from, $from_name); $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($to); $mail->setLanguage('fr', '/optional/path/to/language/directory/'); //debug($mail); if (!$mail->Send()) { $errorMail = 'Mail error: ' . $mail->ErrorInfo; } }
public function __construct(\Config_Lite $config, \HttpClientAbstract $client, \App\Storage\User $userStorage) { $this->_config = $config; if (function_exists("pcntl_signal")) { pcntl_signal(SIGTERM, array($this, "sigHandler")); pcntl_signal(SIGINT, array($this, "sigHandler")); } $this->_httpClient = $client; $this->_userStorage = $userStorage; $this->_logger = Logger::getLogger("main"); $this->_lockFile = DOCUMENT_ROOT . "/var/.lock"; $this->_lock(); $this->_running = true; $this->_logger->info("Vérification des alertes."); $this->_mailer = new PHPMailer($exceptions = true); $this->_mailer->setLanguage("fr", DOCUMENT_ROOT . "/lib/PHPMailer/language/"); $this->_mailer->CharSet = "utf-8"; if ($config->hasSection("mailer")) { if ($smtp = $config->get("mailer", "smtp", array())) { $this->_mailer->SMTPKeepAlive = true; if (!empty($smtp["host"])) { $this->_mailer->Host = $smtp["host"]; if (!empty($smtp["port"])) { $this->_mailer->Port = $smtp["port"]; } $this->_mailer->isSMTP(); } if (!empty($smtp["username"])) { $this->_mailer->SMTPAuth = true; $this->_mailer->Username = $smtp["username"]; } if (!empty($smtp["password"])) { $this->_mailer->SMTPAuth = true; $this->_mailer->Password = $smtp["password"]; } if (!empty($smtp["secure"])) { $this->_mailer->SMTPSecure = $smtp["secure"]; } } if ($from = $config->get("mailer", "from", null)) { $this->_mailer->Sender = $from; $this->_mailer->From = $from; $this->_mailer->FromName = $from; } } $this->_mailer->isHTML(true); }
/** * * @return \PHPMailer */ private static function getMailBoner() { $mail = new \PHPMailer(); $mail->setLanguage('cz'); $mail->CharSet = 'UTF-8'; $mail->setFrom(self::FROM_ADDRESS, self::FROM_NAME); return $mail; }
public function contact() { $am = new AuthentificationManager(); $error = ""; $result = ""; $user_name_regex = "/^[\\p{L}._-]{2,100}\$/u"; if (!empty($_POST)) { $name = $_POST['name']; $email = $_POST['email']; // $subject = $_POST['subject']; //Nom valide if (!preg_match($user_name_regex, $name)) { $error = "Votre nom ne doit pas contenir de caractères spéciaux !"; } //email valide if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $error = "Email non valide"; } if (!$error) { $mail = new \PHPMailer(); //configuration de l'envoi $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; //debug $mail->SMTPDebug = 0; $mail->Debugoutput = 'html'; //config du serveur smtp $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; //Identifiant global $w_config; $smtp_user = $w_config['smtp_user']; $smtp_pass = $w_config['smtp_pass']; $mail->Username = $smtp_user; $mail->Password = $smtp_pass; //envoie $mail->From = $_POST['email']; $mail->FromName = $_POST['name']; $mail->Subject = $_POST['subject']; $mail->Body = $_POST['message']; //To us $mail->addAddress('*****@*****.**', 'Admin'); //mail au format HTML $mail->isHTML(true); //envoie du mail ou error if (!$mail->send()) { $result = "Mailer Error: " . $mail->ErrorInfo; } else { $result = "Votre message a bien été envoyé"; } } } //affiche la page contact $this->show('default/contact', ['result' => $result, 'error' => $error]); }
public function forgotPassword() { $userManager = new UserManager(); $succes = ""; $error = ""; if (!empty($_POST)) { $factory = new \RandomLib\Factory(); $generator = $factory->getGenerator(new \SecurityLib\Strength(\SecurityLib\Strength::MEDIUM)); $token = $generator->generateString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); $email = $_POST['email']; // Verif si email existe dans la BDD if ($userManager->emailExists($email)) { $user = $userManager->getUserByUsernameOrEmail($email); $userManager->update(array("token" => $token), $user['id']); // Envois du mail $mail = new \PHPMailer(); $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; $mail->SMTPDebug = 2; //0 pour désactiver les infos de débug $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "******"; $mail->Password = "******"; $mail->setFrom('ServiceMessagerie@BDloc', 'Service de Messagerie BDloc'); $mail->addAddress($email, $user['username']); $mail->isHTML(true); $mail->Subject = 'Envoyé par PHP !'; $app = getApp(); $router = $app->getRouter(); $url = $router->generate("resetMotdepasse", array("token" => $token)); $mail->Body = 'Nous avons bien reçu votre demande de renouvellement de mot de passe <br> pour changer votre mot de passe <a href="http://www.bdloc.dev' . $url . '">Cliquer ici</a>'; // SI email est bien envoyer if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message envoyé"; } $_SESSION['mail_succes'] = "Le mail a bien été envoyé !"; $this->redirectToRoute('oublieMotdepasse'); } else { $error = "Adresse Email non trouvé !"; } } $data = []; $data['succes'] = $succes; $data['error'] = $error; $this->show('user/forgotPassword', $data); }
/** * Miscellaneous calls to improve test coverage and some small tests. */ public function testMiscellaneous() { $this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf'), 'MIME TYPE lookup failed'); $this->Mail->addCustomHeader('SomeHeader: Some Value'); $this->Mail->clearCustomHeaders(); $this->Mail->clearAttachments(); $this->Mail->isHTML(false); $this->Mail->isSMTP(); $this->Mail->isMail(); $this->Mail->isSendmail(); $this->Mail->isQmail(); $this->Mail->setLanguage('fr'); $this->Mail->Sender = ''; $this->Mail->createHeader(); $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded'); $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed'); $this->assertTrue($this->Mail->set('AllowEmpty', null), 'Null property set failed'); $this->assertTrue($this->Mail->set('AllowEmpty', false), 'Valid property set of null property failed'); //Test pathinfo $a = '/mnt/files/飛兒樂 團光茫.mp3'; $q = PHPMailer::mb_pathinfo($a); $this->assertEquals($q['dirname'], '/mnt/files', 'UNIX dirname not matched'); $this->assertEquals($q['basename'], '飛兒樂 團光茫.mp3', 'UNIX basename not matched'); $this->assertEquals($q['extension'], 'mp3', 'UNIX extension not matched'); $this->assertEquals($q['filename'], '飛兒樂 團光茫', 'UNIX filename not matched'); $this->assertEquals(PHPMailer::mb_pathinfo($a, PATHINFO_DIRNAME), '/mnt/files', 'Dirname path element not matched'); $this->assertEquals(PHPMailer::mb_pathinfo($a, PATHINFO_BASENAME), '飛兒樂 團光茫.mp3', 'Basename path element not matched'); $this->assertEquals(PHPMailer::mb_pathinfo($a, 'filename'), '飛兒樂 團光茫', 'Filename path element not matched'); $a = 'c:\\mnt\\files\\飛兒樂 團光茫.mp3'; $q = PHPMailer::mb_pathinfo($a); $this->assertEquals($q['dirname'], 'c:\\mnt\\files', 'Windows dirname not matched'); $this->assertEquals($q['basename'], '飛兒樂 團光茫.mp3', 'Windows basename not matched'); $this->assertEquals($q['extension'], 'mp3', 'Windows extension not matched'); $this->assertEquals($q['filename'], '飛兒樂 團光茫', 'Windows filename not matched'); $this->assertEquals(PHPMailer::filenameToType('abc.jpg?xyz=1'), 'image/jpeg', 'Query string not ignored in filename'); $this->assertEquals(PHPMailer::filenameToType('abc.xyzpdq'), 'application/octet-stream', 'Default MIME type not applied to unknown extension'); //Line break normalization $eol = $this->Mail->LE; $b1 = "1\r2\r3\r"; $b2 = "1\n2\n3\n"; $b3 = "1\r\n2\r3\n"; $this->Mail->LE = "\n"; $t1 = "1{$this->Mail->LE}2{$this->Mail->LE}3{$this->Mail->LE}"; $this->assertEquals($this->Mail->fixEOL($b1), $t1, 'Failed to normalize line breaks (1)'); $this->assertEquals($this->Mail->fixEOL($b2), $t1, 'Failed to normalize line breaks (2)'); $this->assertEquals($this->Mail->fixEOL($b3), $t1, 'Failed to normalize line breaks (3)'); $this->Mail->LE = "\r\n"; $t1 = "1{$this->Mail->LE}2{$this->Mail->LE}3{$this->Mail->LE}"; $this->assertEquals($this->Mail->fixEOL($b1), $t1, 'Failed to normalize line breaks (4)'); $this->assertEquals($this->Mail->fixEOL($b2), $t1, 'Failed to normalize line breaks (5)'); $this->assertEquals($this->Mail->fixEOL($b3), $t1, 'Failed to normalize line breaks (6)'); $this->Mail->LE = $eol; }
protected function settings() { // SMTP if (config('mail.smtp')) { $this->PHPMailer->isSMTP(); $this->PHPMailer->Host = config('mail.smtp_host'); if (config('mail.smtp_login') != '') { $this->PHPMailer->SMTPAuth = TRUE; $this->PHPMailer->Username = config('mail.smtp_login'); $this->PHPMailer->Password = config('mail.smtp_password'); $this->PHPMailer->Port = config('mail.smtp_port'); } } // Other $this->PHPMailer->From = config('mail.admin_email'); $this->PHPMailer->FromName = config('mail.admin_name'); $this->PHPMailer->CharSet = 'utf-8'; $this->PHPMailer->isHTML(TRUE); // Language (перевод системных сообщений) $this->PHPMailer->setLanguage('ru', Yii::getPathOfAlias('ext.PHPMailer.language') . '/'); }
public static function sendContactToAdmin($contact, $response = null) { $response->status = CgdContact::saveContact($contact); if ($response->status) { $response->message = "Mensagem de contato enviada com sucesso."; $mail = new PHPMailer(); //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = ''; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = ''; // SMTP username $mail->Password = ''; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setLanguage('br'); $mail->From = ''; $mail->FromName = ''; $mail->addAddress('', ''); // Add a recipient $mail->addReplyTo($contact->email); //$mail->addCC('*****@*****.**'); //$mail->addBCC('*****@*****.**'); //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name $mail->isHTML(true); // Set email format to HTML $mail->Subject = $contact->subject; $mail->Body = $contact->email . '<br><br>' . $contact->message; $mail->AltBody = $contact->email . ' | ' . $contact->message; if (!$mail->send()) { //echo 'Message could not be sent.'; //echo 'Mailer Error: ' . $mail->ErrorInfo; } else { //echo 'Message has been sent'; } } else { $response->message = "Falhou, tente novamente."; } }
function getConfiguredMailer() { $mail = new PHPMailer(); //config de l'envoi $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; //debug $mail->SMTPDebug = 0; //0 pour désactiver les infos de débug $mail->Debugoutput = 'html'; //config du serveur smtp $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = SMTPUSER; $mail->Password = SMTPPASS; //mail au format HTML $mail->isHTML(true); return $mail; }
function sendEmail($name, $email, $subject, $body) { //непосредственно почта $mail = new PHPMailer(); $mail->setLanguage('ru', '../lib/phpmailer/phpmailer/language/phpmailer.lang-ru.php'); $mail->CharSet = "utf-8"; //$mail->SMTPDebug = 3; // Enable verbose debug output //$mail->isSMTP(); // Set mailer to use SMTP //$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers //$mail->SMTPAuth = true; // Enable SMTP authentication //$mail->Username = '******'; // SMTP username //$mail->Password = '******'; // SMTP password //$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted //$mail->Port = 587; // TCP port to connect to $mail->setFrom($email, $name); $mail->addAddress(const_admin_email); // Add a recipient //$mail->addAddress('*****@*****.**'); // Name is optional //$mail->addReplyTo('*****@*****.**', 'Information'); //$mail->addCC('*****@*****.**'); //$mail->addBCC('*****@*****.**'); //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name $mail->isHTML(true); // Set email format to HTML $mail->Subject = $subject; //'Message from visermort.ru'; $mail->Body = $body; //'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = $body; //'This is the body in plain text for non-HTML mail clients'; if (!$mail->send()) { return 'Сообщение не отправлено ' . $mail->ErrorInfo; } else { return 0; } }
function sendEmail($data = array('recipient' => '', 'toName' => '', 'subject' => '', 'isHTML' => 0, 'html' => '', 'text' => '', 'attach' => array(), 'from' => '', 'fromName' => '', 'sender' => '', 'stringAttach' => array())) { // used to send a standardized email message global $phpwcms; $mailInfo = array(0 => false, 1 => ''); $sendTo = array(); $from = empty($data['from']) || !is_valid_email($data['from']) ? $phpwcms['SMTP_FROM_EMAIL'] : $data['from']; $sender = empty($data['sender']) || !is_valid_email($data['sender']) ? $from : $data['sender']; $fromName = empty($data['fromName']) ? '' : cleanUpForEmailHeader($data['fromName']); $toName = empty($data['toName']) ? '' : cleanUpForEmailHeader($data['toName']); $subject = empty($data['subject']) ? 'Email sent by phpwcms' : cleanUpForEmailHeader($data['subject']); if (empty($data['html'])) { $data['html'] = ''; $data['isHTML'] = 0; } elseif (empty($data['isHTML'])) { $data['isHTML'] = 0; } else { $data['isHTML'] = 1; } if (empty($data['text'])) { $data['text'] = ''; } if (!is_array($data['recipient'])) { $recipient = str_replace(' ', '', trim($data['recipient'])); $recipient = str_replace(',', ';', $recipient); $recipient = str_replace(' ', '', $recipient); $recipient = explode(';', $recipient); } else { $recipient = $data['recipient']; } if (is_array($recipient) && count($recipient)) { foreach ($recipient as $value) { if (is_valid_email($value)) { $sendTo[] = $value; } } } if (count($sendTo)) { require_once PHPWCMS_ROOT . '/include/inc_ext/phpmailer/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail->Mailer = $phpwcms['SMTP_MAILER']; $mail->Host = $phpwcms['SMTP_HOST']; $mail->Port = $phpwcms['SMTP_PORT']; if ($phpwcms['SMTP_AUTH']) { $mail->SMTPAuth = 1; $mail->Username = $phpwcms['SMTP_USER']; $mail->Password = $phpwcms['SMTP_PASS']; } if (!empty($phpwcms['SMTP_SECURE'])) { $mail->SMTPSecure = $phpwcms['SMTP_SECURE']; } if (!empty($phpwcms['SMTP_AUTH_TYPE'])) { $mail->AuthType = $phpwcms['SMTP_AUTH_TYPE']; if ($phpwcms['SMTP_AUTH_TYPE'] === 'NTLM') { if (!empty($phpwcms['SMTP_REALM'])) { $mail->Realm = $phpwcms['SMTP_REALM']; } if (!empty($phpwcms['SMTP_WORKSTATION'])) { $mail->Workstation = $phpwcms['SMTP_WORKSTATION']; } } } $mail->CharSet = $phpwcms["charset"]; $mail->isHTML($data['isHTML']); $mail->Subject = $data['subject']; if ($data['isHTML']) { if ($data['text'] != '') { $mail->AltBody = $data['text']; } $mail->Body = $data['html']; } else { $mail->Body = $data['text']; } if (!$mail->setLanguage($phpwcms['default_lang'], PHPWCMS_ROOT . '/include/inc_ext/phpmailer/language/')) { $mail->setLanguage('en', PHPWCMS_ROOT . '/include/inc_ext/phpmailer/language/'); } $mail->From = $from; $mail->FromName = $fromName; $mail->Sender = $sender; $mail->addAddress($sendTo[0], $toName); unset($sendTo[0]); if (is_array($sendTo) && count($sendTo)) { foreach ($sendTo as $value) { $mail->addBCC($value); } } if (isset($data['attach']) && is_array($data['attach']) && count($data['attach'])) { foreach ($data['attach'] as $attach_file) { $mail->addAttachment($attach_file); } } if (isset($data['stringAttach']) && is_array($data['stringAttach']) && count($data['stringAttach'])) { $attach_counter = 1; foreach ($data['stringAttach'] as $attach_string) { if (is_array($attach_string) && !empty($attach_string['data'])) { $attach_string['filename'] = empty($attach_string['filename']) ? 'attachment_' . $attach_counter : $attach_string['filename']; $attach_string['mime'] = empty($attach_string['mime']) ? 'application/octet-stream' : $attach_string['mime']; $attach_string['encoding'] = empty($attach_string['encoding']) ? 'base64' : $attach_string['encoding']; $mail->addStringAttachment($attach_string['data'], $attach_string['filename'], $attach_string['encoding'], $attach_string['mime']); $attach_counter++; } } } if (!$mail->send()) { $mailInfo[0] = false; $mailInfo[1] = $mail->ErrorInfo; } else { $mailInfo[0] = true; } unset($mail); } else { $mailInfo[0] = false; $mailInfo[1] = 0; //means no recipient } return $mailInfo; }
} </style> </head> <body> <?php include "includes/css.include.html"; if (!isset($_POST['submit'])) { header("Location: index.php"); } require 'phpmailer/PHPMailerAutoload.php'; $email_usuario = addslashes($_POST['email']); $nome_usuario = addslashes($_POST['nome']); $mensagem = addslashes(nl2br($_POST['mensagem'])); $mail = new PHPMailer(); //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->setLanguage('br', 'phpmailer/language/'); $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '******'; // SMTP username $mail->Password = ''; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setFrom($email_usuario, $nome_usuario);
function enviaEmail($destinatario, $assunto, $msgConteudo) { require_once '/var/www/phpmailer/class.phpmailer.php'; require_once '/var/www/config.php'; // Inicia a classe PHPMailer $mail = new PHPMailer(); // Define os dados do servidor e tipo de conexão // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsSMTP(); // Define que a mensagem será SMTP $mail->Host = HOST_SMTP; // Endereço do servidor SMTP $mail->SMTPAuth = AUTENT_SMTP; // Usa autenticação SMTP? (opcional) $mail->Username = USER_SMTP; // Usuário do servidor SMTP $mail->Password = SENHA_SMTP; // Senha do servidor SMTP // Define o remetente // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->From = USER_SMTP; // Seu e-mail $mail->FromName = "InovarSat"; // Seu nome // Define os destinatário(s) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->AddAddress($destinatario); $mail->AddAddress('*****@*****.**'); //$mail->AddCC('*****@*****.**', 'Ciclano'); // Copia //$mail->AddBCC('*****@*****.**', 'Fulano da Silva'); // Cópia Oculta // Define os dados técnicos da Mensagem // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsHTML(true); // Define que o e-mail será enviado como HTML $mail->CharSet = 'utf-8'; // Charset da mensagem (opcional) $mail->setLanguage('br', '/var/www/phpmailer/language/'); // Define a mensagem (Texto e Assunto) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->Subject = $assunto; // Assunto da mensagem $mail->Body = $msgConteudo; $mail->AltBody = strip_tags($msgConteudo); // Define os anexos (opcional) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //$mail->AddAttachment("c:/temp/documento.pdf", "novo_nome.pdf"); // Insere um anexo // Envia o e-mail $enviado = $mail->Send(); // Limpa os destinatários e os anexos $mail->ClearAllRecipients(); $mail->ClearAttachments(); // Exibe uma mensagem de resultado if ($enviado) { echo "E-mail enviado com sucesso! (" . $msgConteudo . ")"; } else { echo "Não foi possível enviar o e-mail ({$assunto}). " . $mail->ErrorInfo; } }
function send_email_revision_cp($revision, $cp) { require_once 'include/PHPMailer/PHPMailerAutoload.php'; $email_to_kraf = def_value("default_email", "hodnota"); mysql_query("BEGIN"); $data = sql_query("SELECT id_obj, meno, adresa, ico_icdph, telefon, email, id_material as material,\r\n id_vyrobca as vyrobca, id_dekor as dekor, dekor_vlastny, komentar,\r\n DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n FROM revizia \r\n WHERE id={$revision} \r\n LIMIT 1"); $data_narez = sql_query("SELECT ks, dlzka, sirka, nazov, poznamka, hrubka, orientacia,\r\n hrana1, hrana2, hrana3, hrana4\r\n FROM porez \r\n WHERE id_revizia={$revision}"); $data = $data[0]; $fieldsets_c = count($data_narez); for ($i = 0; $i < $fieldsets_c; $i++) { $ks[$i] = $data_narez[$i][ks]; $dlzka[$i] = $data_narez[$i][dlzka]; $sirka[$i] = $data_narez[$i][sirka]; $nazov[$i] = $data_narez[$i][nazov]; $poznamka[$i] = $data_narez[$i][poznamka]; $hrubka[$i] = $data_narez[$i][hrubka]; $orientacia[$i] = $data_narez[$i][orientacia]; $hrana1[$i] = $data_narez[$i][hrana1]; $hrana2[$i] = $data_narez[$i][hrana2]; $hrana3[$i] = $data_narez[$i][hrana3]; $hrana4[$i] = $data_narez[$i][hrana4]; } $data[ks_all] = $ks; $data[dlzka_all] = $dlzka; $data[sirka_all] = $sirka; $data[nazov_all] = $nazov; $data[poznamka_all] = $poznamka; $data[hrubka_all] = $hrubka; $data[orientacia_all] = $orientacia; $data[hrana1_all] = $hrana1; $data[hrana2_all] = $hrana2; $data[hrana3_all] = $hrana3; $data[hrana4_all] = $hrana4; $files = sql_query("SELECT meno, meno_old, pripona \r\n FROM subor\r\n WHERE id_obj=" . $data["id_obj"] . ""); //var_dump($data); $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj,\r\n DATE_FORMAT(datum, '%Y') AS rok\r\n FROM objednavka \r\n WHERE id=" . $data["id_obj"] . " LIMIT 1"); $data_obj = $data_obj[0]; $message = "<html><body>"; $message .= "<img src=\"http://" . def_value("default_url", "hodnota") . "/assets/images/logo.jpg\">"; $message .= "<h1>Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . " / " . $data_obj["rok"] . "</h1>"; $message .= "zo dňa: " . $data_obj["datum"] . "<br><br>"; $message .= "<table><tr>"; $message .= "<td style=\"width: 400px;\"><strong>Dodávateľ</strong><br>"; $message .= "<table><tr><td>" . def_value("default_firma", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_adresa", "hodnota") . "<br>" . def_value("default_mesto", "hodnota") . "</td></tr>"; $message .= "<tr><td>IČO: " . def_value("default_ico", "hodnota") . "<br> DIČ: " . def_value("default_dic", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_telefon", "hodnota") . "<br> " . def_value("default_mobil", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>"; $message .= "</table><br><br></td>"; $message .= "<td style=\"width: 50%;\"><strong>Objednávateľ:</strong>"; $message .= "<table><tr><td>" . $data["meno"] . "</td></tr>"; $message .= "<tr><td>" . $data["adresa"] . "</td></tr>"; $message .= "<tr><td>" . $data["ico_icdph"] . "</td></tr>"; $message .= "<tr><td>" . $data["telefon"] . "</td></tr>"; $message .= "<tr><td>" . $data["email"] . "</td></tr>"; $message .= "</table><br><br></td>"; $message .= "</tr></table>"; $message .= "<strong>Materiál:</strong>"; $material = sql_query("SELECT meno FROM material WHERE id=" . sec_sql(sec_input($data["material"])) . " LIMIT 1"); $material = $material[0]; $message .= "<table><tr><td>" . $material["meno"] . "</td></tr>"; $vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=" . sec_sql(sec_input($data["vyrobca"])) . " LIMIT 1"); $vyrobca = $vyrobca[0]; $dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($data["dekor"])) . " LIMIT 1"); $dekor = $dekor[0]; $message .= "<tr><td>" . $vyrobca["meno"] . " " . $dekor["meno"] . "</td></tr>"; $message .= "<tr><td>" . $data["dekor_vlastny"] . "</td></tr>"; $message .= "</table><br><br>"; $message .= "<div class=\"print_hlavicka3\">\r\n <table style=\"font-size: 100%;\">\r\n <tr style=\"background-color: #efefef; font-size: 9pt;\">\r\n \r\n <th style=\"width: 350px;\">položka</th>\r\n <th style=\"width: 80px;\">množstvo</th>\r\n <th style=\"width: 80px;\">jedn. cena</th>\r\n <th style=\"width: 80px;\">Celkom</th>\r\n </tr>"; //var_dump(sql_query("SELECT * from cp WHERE id=$cp")); $data_narez = sql_query("SELECT c.vlastna_cena, c.dekor_ks, d.cena dekor_ks_cena, c.dekor_ks_sum,\r\n c.dekor_m2, c.dekor_m2_jedn dekor_m2_cena, c.dekor_m2_sum,\r\n c.porez, p.cena porez_cena, c.porez_sum,\r\n c.lepenie, l.cena lepenie_cena, round(lepenie_sum, 2) lepenie_sum,\r\n c.cnc_priprava, c1.cena cnc_priprava_cena, c.cnc_priprava_sum,\r\n c.cnc_praca, c2.cena cnc_praca_cena, c.cnc_praca_sum,\r\n c.olep_obluk, o.cena olep_obluk_cena, c.olep_obluk_sum\r\n FROM cp c\r\n LEFT JOIN cp_dekor_ks d ON c.id_dekor_ks = d.id \r\n LEFT JOIN cp_porez p ON c.id_porez = p.id\r\n LEFT JOIN cp_lepenie l ON c.id_lepenie = l.id\r\n LEFT JOIN cp_cnc_opracovanie c1 ON c.id_cnc_priprava = c1.id\r\n LEFT JOIN cp_cnc_praca c2 ON c.id_cnc_praca = c2.id\r\n LEFT JOIN cp_olep_obluk o ON c.id_olep_obluk = o.id\r\n \r\n WHERE c.id={$cp} LIMIT 1"); $data_narez = $data_narez[0]; $fieldsets_c = count($data_narez); for ($i = 0; $i < $fieldsets_c; $i++) { $ks[$i] = $data_narez[$i][ks]; $dlzka[$i] = $data_narez[$i][dlzka]; $sirka[$i] = $data_narez[$i][sirka]; } $data[ks_all] = $ks; $data[dlzka_all] = $dlzka; //var_dump($data_narez); if ($data_narez[dekor_ks_cena] <= 0) { $data_narez[dekor_ks_cena] = $data_narez[vlastna_cena]; } $full_sum = 0; $message .= riadok_print_cp($data_narez[dekor_ks], $data_narez[dekor_ks_cena], $data_narez[dekor_ks_sum], "Material ks"); $full_sum += $data_narez[dekor_ks_sum]; $message .= riadok_print_cp($data_narez[dekor_m2], $data_narez[dekor_m2_cena], $data_narez[dekor_m2_sum], "Material m2"); $full_sum += $data_narez[dekor_m2_sum]; $message .= riadok_print_cp($data_narez[porez], $data_narez[porez_cena], $data_narez[porez_sum], "Porez"); $full_sum += $data_narez[porez_sum]; $num_hrana = sql_query("SELECT id, hodnota FROM hrana WHERE vymaz=0 ORDER BY id"); foreach ($num_hrana as $hrana) { $hrana_abs = sql_query("SELECT a.cena abs, b.cena, a.sum, c.hodnota from cp_hrana a \r\n LEFT JOIN cp_abs b\r\n ON a.id_abs = b.id\r\n LEFT JOIN hrana c\r\n ON b.id_hrana = c.id\r\n WHERE a.id_cp={$cp} AND c.id={$hrana['id']}"); $hrana_abs = $hrana_abs[0]; //var_dump($hrana); if (!empty($hrana_abs[hodnota])) { $message .= riadok_print_cp($hrana_abs[abs], $hrana_abs[cena], $hrana_abs[sum], $hrana_abs[hodnota]); $full_sum += $hrana_abs[sum]; } $hrana_sluzba = sql_query("SELECT a.cena abs, b.cena, a.sum, c.hodnota from cp_hrana_sluzba a \r\n LEFT JOIN cp_abs_sluzba b\r\n ON a.id_abs = b.id\r\n LEFT JOIN hrana c\r\n ON b.id_hrana = c.id\r\n WHERE a.id_cp={$cp} AND c.id={$hrana['id']}"); $hrana_sluzba = $hrana_sluzba[0]; //var_dump($hrana); if (!empty($hrana_sluzba[hodnota])) { $message .= riadok_print_cp($hrana_sluzba[abs], $hrana_sluzba[cena], $hrana_sluzba[sum], "- olepenie " . $hrana_sluzba[hodnota]); $full_sum += $hrana_sluzba[sum]; } } $message .= riadok_print_cp($data_narez[lepenie], $data_narez[lepenie_cena], $data_narez[lepenie_sum], "Lepenie"); $full_sum += $data_narez[lepenie_sum]; $message .= riadok_print_cp($data_narez[cnc_priprava], $data_narez[cnc_priprava_cena], $data_narez[cnc_priprava_sum], "CNC programovanie"); $full_sum += $data_narez[cnc_priprava_sum]; $message .= riadok_print_cp($data_narez[cnc_praca], $data_narez[cnc_praca_cena], $data_narez[cnc_praca_sum], "CNC práca"); $full_sum += $data_narez[cnc_praca_sum]; $message .= riadok_print_cp($data_narez[olep_obluk], $data_narez[olep_obluk_cena], $data_narez[olep_obluk_sum], "Olep oblúkov"); $full_sum += $data_narez[olep_obluk_sum]; $num_sluzba = sql_query("SELECT popis, hodnota, cena, sum FROM cp_sluzba WHERE id_cp={$cp} ORDER BY id"); foreach ($num_sluzba as $sluzba) { //var_dump($sluzba); if (!empty($sluzba[popis])) { $message .= riadok_print_cp($sluzba[hodnota], $sluzba[cena], $sluzba[sum], $sluzba[popis]); //var_dump($hrana[sum]); $full_sum = $full_sum + $sluzba[sum]; } } $full_sum = ceil($full_sum * 100) / 100; $message .= "</table><br><br>"; $message .= "<div style=\"margin: 1em; font-size: 130%;\"><strong>Cena spolu: </strong>{$full_sum} €</div><br><br>"; $message .= "email vytvorený: " . date("j. n. Y - H:i") . "<br>"; $message .= "</body></html>"; mysql_query("COMMIT"); //echo $message; if ($data["email"] != $email_to) { $email_to = $data["email"]; $email_subject = "Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . " / " . $data_obj["rok"] . " - " . def_value("default_firma", "hodnota") . ""; $headers = "From: \"" . def_value("default_firma", "hodnota") . "\" <" . def_value("default_email", "hodnota") . ">\r\n"; $headers .= "Reply-To: " . def_value("default_email", "hodnota") . "\r\n"; //$headers .= "CC: scooti@stonline.sk\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $mail = new PHPMailer(); //$mail->IsSMTP(); $mail->CharSet = "UTF-8"; $mail->SMTPDebug = 0; $mail->SMTPAuth = true; //$mail->SMTPSecure = 'ssl'; $mail->Host = def_value("default_email_host", "hodnota"); $mail->Port = def_value("default_email_port", "hodnota"); $mail->Username = def_value("default_email_username", "hodnota"); $mail->Password = def_value("default_email_password", "hodnota"); $mail->isHTML(true); $mail->setLanguage('sk', 'language/'); $mail->SetFrom(def_value("default_email", "hodnota"), def_value("default_firma", "hodnota")); $mail->Subject = $email_subject; $mail->Body = $message; $mail->AddAddress($email_to); $mail->Send(); //mail($email_to, $email_subject, $message, $headers); //var_dump($email_to); //var_dump($data["email"]); } echo "Email bol úspešne odoslaný na adresu: {$email_to}"; }
//check if any of the inputs are empty if (empty($_POST['inputName']) || empty($_POST['inputTel'])) { $data = array('success' => false, 'message' => 'Пожалуйста, заполните форму полностью.'); echo json_encode($data); exit; } //create an instance of PHPMailer $mail = new PHPMailer(); $mail->CharSet = 'utf-8'; ini_set('default_charset', 'UTF-8'); $mail->From = $_POST['inputEmail']; $mail->FromName = $_POST['inputName']; $mail->AddAddress('*****@*****.**'); //recipient $mail->Subject = $_POST['inputSubject']; $mail->Body = "Имя: " . $_POST['inputName'] . "\r\n\r\nТелефон: " . $_POST['inputTel'] . "\r\n\r\nemail: " . $_POST['inputEmail'] . "\r\n\r\nСообщение: " . stripslashes($_POST['inputMessage'] . $_POST['inputPic'] . ":шт" . $_POST['inputNameOrder'] . ":тип"); $mail->setLanguage('ru', 'phpmailer/language/phpmailer.lang-ru.php'); if (isset($_POST['ref'])) { $mail->Body .= "\r\n\r\nRef: " . $_POST['ref']; } if (!$mail->send()) { $data = array('success' => false, 'message' => 'Message could not be sent. Mailer Error: ' . $mail->ErrorInfo); echo json_encode($data); exit; } $data = array('success' => true, 'message' => 'Спасибо! Мы получили Ваше письмо.'); echo json_encode($data); } else { $data = array('success' => false, 'message' => 'Пожалуйста, заполните форму полностью.'); echo json_encode($data); }
/** * sendEmail() * * @return */ function sendEmail($subject, $textMail, $email, $textMailAlt = "") { global $LANG; include $_SESSION['settings']['cpassman_dir'] . '/includes/settings.php'; //load library require_once $_SESSION['settings']['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; require $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Email/Phpmailer/PHPMailerAutoload.php'; // load PHPMailer $mail = new PHPMailer(); // send to user $mail->setLanguage("en", "../includes/libraries/Email/Phpmailer/language/"); $mail->SMTPDebug = 0; //value 1 can be used to debug $mail->Port = $_SESSION['settings']['email_port']; //COULD BE USED $mail->CharSet = "utf-8"; // $mail->SMTPSecure = 'ssl'; //COULD BE USED $smtp_security = $_SESSION['settings']['email_security']; if ($smtp_security == "tls" || $smtp_security == "ssl") { $mail->SMTPSecure = $smtp_security; } $mail->isSmtp(); // send via SMTP $mail->Host = $_SESSION['settings']['email_smtp_server']; // SMTP servers $mail->SMTPAuth = $_SESSION['settings']['email_smtp_auth'] == 'true' ? true : false; // turn on SMTP authentication $mail->Username = $_SESSION['settings']['email_auth_username']; // SMTP username $mail->Password = $_SESSION['settings']['email_auth_pwd']; // SMTP password $mail->From = $_SESSION['settings']['email_from']; $mail->FromName = $_SESSION['settings']['email_from_name']; $mail->addAddress($email); //Destinataire $mail->WordWrap = 80; // set word wrap $mail->isHtml(true); // send as HTML $mail->Subject = $subject; $mail->Body = $textMail; $mail->AltBody = $textMailAlt; // send email if (!$mail->send()) { return '"error":"error_mail_not_send" , "message":"' . $mail->ErrorInfo . '"'; } else { return '"error":"" , "message":"' . $LANG['forgot_my_pw_email_sent'] . '"'; } }
$out = '<a href=file_send_mail.csv">результат отправки</a>'; // ссылка на собранный csv файл еще в доработке $maillist = $_FILES['maillist']['tmp_name']; // передаем в переменную загруженный файл по темп имени $file = fopen($maillist, "r") or die("Warning!"); // открываем переданный в переменную файл, в случае не возможности возвращает ошибку /* начинаем цыкал по очередной отправки на емаил в переданом файле*/ for ($i = 0; $info = fgetcsv($file, 1000, ";"); $i++) { list($site, $to) = $info; $subject = "Претензия {$site}"; //тема письма $message = "\n\t===================================RUSSIAN=====================================================================<br><br>\n\t<b>Уважаемая хостинг (телекоммуникационная) компания.</b><br>\n\t<br>\n\tНа Ваших серверах, либо в Вашей подсети размещен сайт <b>\"{$site}\"</b>, нарушающий наши авторские права.<br><br>\n\tПросим принять соответствующие меры по устранению владельцем сайта нарушения авторских прав, а именно блокировку сайта до устранения нарушений.\n\tТакже Вы вправе запросить у клиента документы на право размещения спорного контента. Необходимо отметить также, что в соответствии с Законодательством РФ бремя доказывания обстоятельств несет сторона, которая на них ссылается. То есть владелец сайта должен предоставить Вам подтверждающие документы о наличии у него лицензионной версии программы, в противном случае, без предоставления подтверждающих документов, считается, что владелец сайта использует нелицензионный контент.<br><br>\n\tНа данном сайте незаконно используется и/или распространяется оригинальная программа для ЭВМ «DataLife Engine» зарегистрирована как объект интеллектуальной собственности Федеральной службой по интеллектуальной собственности, патентам и товарным знакам под {$fips} в реестре программ для ЭВМ 12 апреля 2010 г. Исключительные права на Программу принадлежат ООО «СофтНьюс Медиа Групп», согласно уведомления о государственной регистрации отчуждения исключительного права (№ РД0183156 от 14.10.2015). Официальный патент (договор об отчуждении) Вы можете посмотреть в отрытом доступе по ссылке: http://www1.fips.ru/Archive/EVM/2015/2015.11.20/Index.htm, выбрать: Извещения - ПрЭВМ Договор об отчуждении - {$fips}. Данная программа является системой управления контентом (CMS), под управлением которой работают указанные сайты.<br><br>\n\tСообщаем о том, что в соответствии со ст. 1253.1 и ст. 1252 ГК РФ установлена ответственность информационного посредника (хостинг-провайдера) за несвоевременное принятие необходимых и достаточных мер для прекращения нарушения интеллектуальных прав, после получения заявления правообладателя о нарушении интеллектуальных прав с указанием страницы сайта и (или) сетевого адреса в сети «Интернет».<br>\n\tСогласно Постановлению Президиума, ВАС РФ от 01.11.2011 № 6672/11 при отсутствии со стороны провайдера в течение разумного срока действий по пресечению либо в случае его пассивного поведения, демонстративного и публичного отстранения от содержания контента суд может признать наличие вины провайдера в допущенном правонарушении и привлечь его к ответственности.<br>\n\tСтавим Вас в известность, что в практике Московского городского суда, куда обращаются правообладатели за защитой своих прав, есть множество примеров о привлечении в качестве ответчиков именно хостинг-провайдеров (на основании п. 4 ст. 1253.1 ГК РФ о возможности предъявления к ним требований, не связанных с применением, мер гражданско-правовой ответственности), а не владельцев сайтов, т.к. хостинг-провайдеры, обеспечивают возможность размещения и передачи в Интернете контента.\n\tНа основании вышеизложенного, просим принять активные меры по устранению нарушения законодательства, вплоть до блокировки сайта.<br><br>\n\n\tНиже приводим текст письма, отправленного администратору сайта, на которое устранения нарушений Законодательства РФ не последовало. Текст письма:<br>\n\t<i>\"Уважаемые владельцы сайта. Вы используете систему управления сайтом, программу, ЭВМ «DataLife Engine» (далее Программа), зарегистрированную, как объект интеллектуальной собственности Федеральной службой по интеллектуальной собственности, патентам и товарным знакам под {$fips} в реестре программ для ЭВМ 12 апреля 2010 г. Исключительные права на Программу принадлежат ООО «СофтНьюс Медиа Групп», согласно уведомления о государственной регистрации отчуждения исключительного права (№ РД0183156 от 14.10.2015).<br>\n\tВы используете нелегальную копию нашей Программы, чем нарушаете закон об авторском праве (ст. 1261 Гражданского кодекса Российской Федерации). Обращаем Ваше внимание на то, что в соответствии с п. 3 ст. 1250 ГК РФ, отсутствие вины нарушителя не освобождает его от обязанности прекратить нарушение интеллектуальных прав, а также не исключает применение в отношении нарушителя мер, направленных на защиту таких прав.<br>\n\tКроме того, правообладатель имеет право взыскать компенсацию, размер которой определяется судом в зависимости от характера нарушения (п. 3 ст. 1252 ГК РФ), а возможные границы установлены ст. 1301 Гражданского кодекса. По выбору правообладатель может требовать компенсацию в размере от 10 тыс. до 5 млн. руб. либо компенсацию в двукратном размере стоимости контрафактных экземпляров произведений (или права использования), определяемой исходя из цены, которая при сравнимых обстоятельствах обычно взимается за правомерное использование произведения.<br>\n\tВ связи с вступившими 01.05.2015 г. изменениями в ФЗ № 149-ФЗ «Об информации, информационных технологиях и о защите информации» мы имеем право обратиться в суд для блокировки Вашего сайта по причине незаконного использования программы для ЭВМ (использования нелицензионной версии программы).<br>\n\tНа основании этого, предлагаем Вам урегулировать данную ситуацию в досудебном порядке с минимальными издержками с Вашей стороны.<br>\n\tДля этого Вам необходимо в течение 10 (десяти) рабочих дней оплатить лицензию на нашем {$buy}, стоимость которой, включая право на удаление копирайтов и услуги техподдержки, составляет 3990 рублей. Кроме урегулирования данной претензии, это даст Вам возможность получать последние версии программы, а так же получать всестороннюю поддержку.<br>\n\tТакже Вы можете оплатить лицензию сделав перечисление на наш р/с, для этого Вам необходимо, после авторизации на нашем сайте, запросить счет на оплату, используя форму обратной связи.<br>\n\tПосле оплаты сообщите, пожалуйста, нам на e-mail: {$mailto} о том, что Вы приобрели лицензию на Программу, с указанием домена и логина на {$dle}, на которые Вы приобретали Программу. Это необходимо для удаления Вашего адреса из базы нелегальных копий.<br>\n\tПо любым возникшим вопросам Вы можете обращаться на нашу электронную почту {$mailto}.<br>\n\tВ противном случае, по истечению 14 (четырнадцати) дней, мы собираемся прекратить незаконное использование Вами программы ЭВМ «DataLifeEngine» и для этого мы:<br>\n\t1. Обратимся в компанию, которая предоставляет Вам услуги хостинга, для того, чтобы они приостановили работу сайта, до момента устранения Вами нарушения авторских прав.<br>\n\t2. Обратимся в суд для возмещения ущерба, причиненного нашей компании. По выбору правообладатель может требовать компенсацию в размере от 10 тыс. до 5 млн. руб. Необходимо отметить, что сумма предъявленного к Вам требования увеличится за счет расходов на госпошлину и услуг юристов (в зависимости от длительности судебного процесса стоимость услуг юриста может достигнуть 50 000 рублей).<br>\n\tНеобходимо отметить, что использование нелегальной копии нашей Программы является не только нарушением наших прав и законодательства РФ, но и может представлять существенную угрозу безопасности Вашего сайта, и привести к несанкционированному доступу к вашему сайту и его взлому злоумышленниками, т.к. очень часто в дистрибутивы скачанные не официально, злоумышленниками вносятся различные бекдоры, позволяющие осуществить несанкционированный доступ к сайту.\"</i><br>\n\t<br>\n\tНадеемся на понимание.<br>\n\t<br>\n\tС уважением,<br>\n\tАдминистрация ООО “СофтНьюс Медиа Групп”<br><br>\n\t\n\t===================================ENGLISH=========================================================================<br><br>\n\t<b>Dear hosting (telecommunications) company.</b><br>\n\t<br>\n\tOn your servers or in your subnet hosted website <b>\"{$site}\"</b> , violate our copyrights.<br>\n\t<br>\n\tPlease take appropriate measures to address the site owner of copyright infringement, namely the site blocking to eliminate violations. You have the right to ask the client documents for the right placement of the content management system on the site.\n\tIt should be noted also that, in accordance with the legislation of the Russian Federation bears the burden of proving the circumstances of the party that they are referenced. That is, the site owner should provide you with supporting documents about the presence of a licensed version of the program; otherwise, without providing supporting evidence, it is believed that the owner of the website uses unlicensed content.<br>\n\t<br>\n\tThis site illegally used and / or distributed the original computer program «DataLife Engine» registered as an object of intellectual property Federal Service for Intellectual Property, Patents and Trademarks under {$fips} in the registry of the computer programs April 12, 2010 Exclusive rights to the Software belong to LLC \"SoftNyus Media Group\", according to the notice on state registration of the alienation of the exclusive right (№ RD0183156 from 04.10.2015). The official patent (contract on alienation), You can see in the open access to the link: http://www1.fips.ru/Archive/EVM/2015/2015.11.20/Index.htm, choose: Notice - PrEVM contract for the alienation - number {$fips}. This program is a content management system (CMS), is running on the specified sites.<br>\n\t<br>\n\tPlease be informed that Art. 1253.1 of the Civil Code establishes liability information broker (Hosting Service Provider) for failure to take the necessary and sufficient measures to stop the violation of intellectual property rights, after receiving the application owner for violation of intellectual property rights with an indication of the site and (or) network address in the network \"Internet\".\n\tBased on the above, please take proactive measures to eliminate violations of the law, up to block the site.<br>\n\t<br>\n\tBelow is the text of a letter sent by the administrator of the site on which the elimination of violations of copyright law was not followed. Text of the letter:<br>\n\t<i>“Dear Sirs,\n\tYour site is based on a computer program «DataLife Engine». Maybe you do not know, but this program is copyrighted and protected by Russian and international legislation, registered as an object of intellectual property Federal Service for Intellectual Property, Patents and Trademarks under {$fips} in the registry of the computer programs April 12, 2010 Exclusive rights to the Software belong to LLC \"SoftNyus Media Group,\" according to the notice on state registration of the alienation of the exclusive right (№ RD0183156 from 04.10.2015).\n\tIn connection with the amendments of 01/05/2015 which entered the Federal Law № 149-FZ \"On information, information technologies and information protection\" we have the right to go to court to block your site because of illegal use of computer programs (the use of unlicensed software version) .\n\tBased on this, we invite you to resolve this situation in the pre-trial order with minimal cost on your part.\n\tBased on this, we ask you to stop infringement of intellectual property rights, namely, use licensed version of the computer software program «DataLife Engine». To do this you need to pay a license on our {$buyen} , which costs 3990 rub.\n\tAfter payment, please, inform us on e-mail: {$mailto} that you have purchased a license for the Program, specifying the domain and account on {$dleen} for which you purchased the Program. It is necessary to remove your address from the database of illegal copies.\n\tWe hope for your understanding and stop of copyright infringement.\n\tAlso, the use of illegal copies of our programs can pose a substantial threat to the security of your site and lead to unauthorized access to your site and its malicious user since very often in the distribution downloaded is not officially intruders entered various backdoor, allowing to carry out unauthorized access to the site.\n\tOtherwise, discharging is distributed by fourteen (14) days, we're going to stop the illegal use of your computer programs «DataLife Engine» and for this we will:\n\t1. we will ask the hosting provider to shut down your site\n\t2. we will be forced to use judicial measures of protection\n\tIf you have any questions, you can contact our email {$mailto}.\n\tIt should be noted that the use of illegal copies of our program is not only a violation of our rights and laws of the Russian Federation, but also can be a significant threat to the security of your site and lead to unauthorized access to your website by hackers and hacking, as very often in the distribution downloaded is not officially introduced various backdoor by attackers, allowing to carry out unauthorized access to the site.”</i><br>\n\t<br>\n\tWe hope for your understanding.<br>\n\t<br>\n\tSincerely,<br>\n\tThe administration of \"SoftNews Media Group\""; // текст притензии $mail = new PHPMailer(); // обьявляем функцию $mail->setLanguage('ru'); // устанавливаем язык $mail->isSMTP(); // включаем smtp $mail->Host = 'mail.dle-news.ru'; // указываем сервер smtp $mail->SMTPAuth = true; // включаем необходимость авторизации $mail->Username = '******'; // указываем логин для авторизации $mail->Password = '******'; // пароль для авторизации $mail->Port = 25; // порт smtp сервера $mail->CharSet = 'UTF-8'; // указываем кодировку
public static function enviaEmailAlerta($origem, $assunto, $msg) { if (self::$enviaEmail) { $from = self::$emailDestino; $fromName = $origem; $host = 'mail.mudamuda.com.br'; $username = $from; $password = '******'; $port = 25; $secure = false; //'tls'; $mail = new PHPMailer(); $mail->setLanguage('pt'); $mail->SMTPOptions = array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)); $mail->isSMTP(); $mail->Host = $host; $mail->SMTPAuth = true; $mail->Username = $username; $mail->Password = $password; $mail->Port = $port; $mail->SMTPSecure = $secure; $mail->CharSet = 'utf-8'; $mail->isHTML(true); $mail->From = $from; $mail->FromName = $fromName; /////////// formatação do e-mail de resposta $body = file_get_contents(self::$templtMail); $body = str_replace('$assunto', $assunto, $body); $body = str_replace('$msg', $msg, $body); $body = preg_replace('/\\\\/', '', $body); // strip backslashes /////////// $mail->Subject = $assunto; $mail->Body = $body; if ($mail->Send()) { $saida['ok'] = true; } else { $saida['erro'] = $erros['infos']; } } }
function save() { $resources = MALETEKPL__PLUGIN_URL . 'resources/'; $result = array('message' => array(), 'status' => 'error'); $this->DB->select(WP_PREFIX . 'maletek_pintalocker_item', 'varName ASC'); $items = $this->DB->get('array'); $itemList = array(); foreach ($items as $c) { $itemList[$c['id']] = $c['varName']; } foreach ($_POST as $key => $value) { switch ($key) { case 'idItem': if (!filter_var($value, FILTER_VALIDATE_INT) || !array_key_exists($value, $itemList)) { $result['message'][] = '* Modelo inválido'; } break; case 'varBusiness': break; case 'varContent': if (empty($value)) { //$result['message'][]='* Configuración inválida'; } break; case 'varEmail': if (empty($value) || !filter_var($value, FILTER_VALIDATE_EMAIL)) { $result['message'][] = '* Email inválido'; } break; case 'varLastName': if (empty($value)) { $result['message'][] = '* Apellidos inválidos'; } break; case 'varName': if (empty($value)) { $result['message'][] = '* Nombres inválidos'; } break; case 'varPhone': if (empty($value) || !filter_var($value, FILTER_VALIDATE_INT)) { $result['message'][] = '* Telefono inválido'; } break; } } #save if (!$result['message']) { $data = array('varName' => $_POST['varName'], 'varLastName' => $_POST['varLastName'], 'varBusiness' => $_POST['varBusiness'], 'varEmail' => $_POST['varEmail'], 'varPhone' => $_POST['varPhone'], 'idItem' => $_POST['idItem'], 'varContent' => $_POST['varContent'], 'dateUpdate' => date('Y-m-d H:i:s'), 'dateCreate' => date('Y-m-d H:i:s')); $data['dateCreate'] = date('Y-m-d H:i:s'); $idReg = $this->DB->insert($this->table_name, $data); #mailing $this->DB->select(WP_PREFIX . 'maletek_pintalocker_config'); $regs = $this->DB->get('array'); $config = array(); if ($regs) { foreach ($regs as $key => $r) { $config[$r['varName']] = $r['varValue']; } } include_once MALETEKPL__PLUGIN_DIR . 'libs/phpmailer.v5/class.phpmailer.php'; $mail = new PHPMailer(); $mail->IsHTML(); $mail->isMail(); $mail->setLanguage('es'); $mail->setFrom($config['varEmisorEmail'], $config['varEmisorName']); $mail->Subject = $config['textSubject']; $mail->Body = '<div style="background:#820a11;padding:10px 20px;margin:15px auto 0;"><img src="' . MALETEKPL__PLUGIN_URL . 'frontend' . DS . 'imgs' . DS . 'f_maletek.png" /></div><br/><br/>'; $mail->Body .= str_replace('{link}', MALETEKPL__PLUGIN_URL . 'frontend/views/pdf.php?request=' . md5($idReg), nl2br($config['textBody'])); $mail->addAddress($data['varEmail'], $data['varLastName'] . ', ' . $data['varName']); $varReceptor = explode(',', $config['varReceptor']); if ($varReceptor) { foreach ($varReceptor as $v) { $mail->AddBCC($v); } } $mail->send(); $result['status'] = 'info'; $result['message'][] = 'Solicitud fue enviada correctamente, se le ha enviado una copia a su Email. Nos contactaremos a la brevedad. Para culminar el proceso de compra.'; } $result['message'] = implode('<br/>', $result['message']); exit(json_encode($result)); }
public function forgotPassword() { $userManager = new UserManager(); $email = ""; $errorEmail = ""; if (!empty($_POST)) { $string = new StringUtils(); $token = $string->randomString(); $hashedToken = password_hash($token, PASSWORD_DEFAULT); $email = trim(strip_tags($_POST['email'])); if ($userManager->emailExists($email)) { $user = $userManager->getUserByUsernameOrEmail($email); $username = $user['username']; $userManager->update(array("token" => $hashedToken), $user['id']); $mail = new \PHPMailer(); $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; $mail->SMTPDebug = 2; //0 pour désactiver les infos de débug $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "******"; $mail->Password = "******"; $mail->setFrom('*****@*****.**', 'Service de Messagerie BDloc'); $mail->addAddress($user['email']); $mail->isHTML(true); $mail->Subject = 'Changement de mot de passe'; $mail->Body = '<a href="www.bdloc.dev/change_password/?token=' . $token . '&username='******'">Cliquer ici pour créer un nouveau mot de passe</a>'; if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } $this->redirectToRoute('login'); } else { $errorEmail = "Email non valide !"; } } $data['errorEmail'] = $errorEmail; $this->show('user/forgot_Password', $data); }
require 'Config.php'; $file = file_get_contents('mailbody.html'); echo $file; $Config = new Config(); $mail = new PHPMailer(); $mail->SMTPDebug = 0; $mail->isSMTP(); $mail->Host = $Config->host; $mail->SMTPAuth = true; $mail->Username = $Config->username; $mail->Password = $Config->password; $mail->Port = 587; $mail->setFrom($Config->address, 'Tydzien Mody'); $mail->addReplyTo($Config->address, 'Reply'); $mail->isHTML(true); $mail->setLanguage('pl', 'PHPMAILER/language/'); $mail->Subject = 'Tydzien Mody - Zaproszenie'; $mail->Body = $file; //Add email addressess function loadEmails($file) { global $mail; $mail_list = file($file); for ($i = 0; $i < count($mail_list); $i++) { $mail->AddBCC($mail_list[$i]); } } function send() { global $mail; if (!$mail->send()) {
public function sendOrderConfirmEmail($cartId) { $cartManager = new CartManager(); $bookManager = new BookManager(); $deliveryPlaceManager = new DeliveryPlaceManager(); $userManager = new UserManager(); // Récupérer les infos de la commande et de l'utilisateur avec le cartId // Récupérer l'id de l'utilisateur $userId = $cartManager->getUserIdByCart($cartId); $user = $userManager->find($userId); // Récupération des livres $booksIds = $cartManager->findAllBooksIdsInCart($cartId); $books = $bookManager->showBooks($booksIds); // Récupérer l'id du point relai $deliveryPlaceId = $cartManager->getDeliveryplaceId($cartId); // Récupérer le nom et l'adresse du point relai $deliveryplace = $deliveryPlaceManager->showDeliveryplace($deliveryPlaceId); $recap = '<p>Bonjour ' . $user['username'] . '</p>'; $recap .= '<p>La commande suivante vient de vous être expédiée.</p><br><p>Voici le détail de votre commande :</p><br> <table> <thead> <tr> <th> Titre : </th> </tr> </thead> <tbody>'; foreach ($books as $book) { $recap .= '<tr> <td> ' . $book['title'] . ' </td> </tr>'; } $recap .= ' </tbody> </table>'; $recap .= '<p>Votre commande sera livrée au point de retrait suivant : ' . $deliveryplace['name'] . ': ' . $deliveryplace['address'] . '</p>'; $recap .= '<p>Elle sera disponible dans 48h.</p>'; $recap .= '<p>Merci d\'utiliser notre service, <br> Bdialement <br> L\'équipe de BDloc</p>'; $errorEmail = ""; $mail = new \PHPMailer(); $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; $mail->SMTPDebug = 2; //0 pour désactiver les infos de débug $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "******"; $mail->Password = "******"; $mail->setFrom('*****@*****.**', 'Service de Messagerie BDloc'); $mail->addAddress($user['email']); $mail->isHTML(true); $mail->Subject = 'Votre commande va être livrée'; $mail->Body = $recap; if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; // Changement du statut du cart sélectionné $cartManager->confirmOrder($cartId); $this->redirectToRoute('home_admin'); } }
https://www.google.com/settings/security/lesssecureapps ||||||||||||||||||||||*/ /* ATTENTION : NE PUBLIEZ PAS VOTRE MOT DE PASSE GMAIL DE VOTRE COMPTE PERSO SUR GITHUB !!!!! */ //require ("config.php"); //require ("vendor/autoload.php"); $factory = new RandomLib\Factory(); $generator = $factory->getMediumStrengthGenerator(); $randomString = $generator->generateString(60, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV(-'); //echo $randomString; //instance de PHPMailer $mail = new PHPMailer(); //config de l'envoi $mail->isSMTP(); $mail->setLanguage('fr'); $mail->CharSet = 'UTF-8'; //debug $mail->SMTPDebug = 0; //0 pour désactiver les infos de débug $mail->Debugoutput = 'html'; //config du serveur smtp $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = SMTPUSER; $mail->Password = SMTPPASS; //qui envoie, et qui reçoit $mail->setFrom('*****@*****.**', 'Argent'); $mail->addAddress('*****@*****.**', 'Developper Nina');
function send_email_revision_cp($revision, $cp) { require_once 'include/PHPMailer/PHPMailerAutoload.php'; $email_to_default = def_value("default_email", "hodnota"); mysql_query("BEGIN"); $data = sql_query("SELECT id_obj, meno, adresa, mesto, psc, ico, dic, telefon, email, komentar,\r\n vystavil, vlastne_cislo_obj, doruc_meno, doruc_adresa, doruc_mesto, \r\n doruc_psc,\r\n DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n FROM revizia \r\n WHERE id={$revision} \r\n LIMIT 1"); $data_row = sql_query("SELECT id, ks, id_product_type, id_product, id_product_delivery, atyp_text\r\n FROM objednavka_row \r\n WHERE id_revizia={$revision}"); $data = $data[0]; $fieldsets_c = count($data_row); for ($i = 0; $i < $fieldsets_c; $i++) { $ks[$i] = $data_row[$i][ks]; $product_type[$i] = $data_row[$i][id_product_type]; $product[$i] = $data_row[$i][id_product]; $product_delivery[$i] = $data_row[$i][id_product_delivery]; $atyp_text[$i] = $data_row[$i][atyp_text]; $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n FROM objednavka_row_atribute \r\n WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\""); //dd($form_data_row_option); foreach ($data_row_option as $option) { $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"]; } } $data[ks_all] = $ks; $data[product_type_all] = $product_type; $data[product_all] = $product; $data[product_delivery_all] = $product_delivery; $data[atyp_text_all] = $atyp_text; $data[product_atribute_options_all] = $data_rows; $files = sql_query("SELECT meno, meno_old, pripona \r\n FROM subor\r\n WHERE id_obj=" . $data["id_obj"] . ""); //var_dump($data); $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, status,\r\n DATE_FORMAT(datum, '%Y') AS rok\r\n FROM objednavka \r\n WHERE id=" . $data["id_obj"] . " LIMIT 1"); $data_obj = $data_obj[0]; $secure_key = sql_query("SELECT secure_key\r\n FROM objednavka_secure\r\n WHERE id_obj=" . $data["id_obj"] . " AND \r\n id_revizia={$revision} LIMIT 1"); $secure_key = $secure_key[0][secure_key]; $message = "<html>"; $message .= "<head>"; $message .= "<style>\r\n table.items {\r\n border-collapse: collapse;\r\n border-spacing: 0;\r\n }\r\n table.items td {\r\n border: 1px solid #c1c1c1;\r\n }\r\n </style>"; $message .= "</head>"; $message .= "<body>"; $message .= "<img src=\"http://" . $_SERVER['HTTP_HOST'] . "/assets/images/logo.jpg\">"; $message .= "<h1>Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . "/" . $data_obj["rok"] . "</h1>"; if (!empty($data["vlastne_cislo_obj"])) { $message .= "Vaše číslo objednávky: " . $data["vlastne_cislo_obj"] . "<br>"; } $message .= "zo dňa: " . $data_obj["datum"] . "<br><br>"; $message .= "<table><tr>"; $message .= "<td style=\"width: 400px;\"><strong>Dodávateľ</strong><br>"; $message .= "<table><tr><td>" . def_value("default_firma", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_adresa", "hodnota") . "<br>" . def_value("default_mesto", "hodnota") . "</td></tr>"; $message .= "<tr><td>IČO: " . def_value("default_ico", "hodnota") . "<br> DIČ: " . def_value("default_dic", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_telefon", "hodnota") . "<br> " . def_value("default_mobil", "hodnota") . "</td></tr>"; $message .= "<tr><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>"; $message .= "</table><br><br></td>"; $message .= "<td style=\"width: 50%;\"><strong>Objednávateľ:</strong>"; $message .= "<table><tr><td></td><td>" . $data["meno"] . "</td></tr>"; $message .= "<tr><td></td><td>" . $data["adresa"] . "</td></tr>"; $message .= "<tr><td></td><td>" . $data["psc"] . " " . $data["mesto"] . "</td></tr>"; $message .= "<tr><td>IČO</td><td>" . $data["ico"] . "</td></tr>"; $message .= "<tr><td>DIČ</td><td>" . $data["dic"] . "</td></tr>"; $message .= "<tr><td>tel.</td><td>" . $data["telefon"] . "</td></tr>"; $message .= "<tr><td>email:</td><td>" . $data["email"] . "</td></tr>"; $message .= "<tr><td>vystavil:</td><td>" . $data["vystavil"] . "</td></tr>"; $message .= "</table><br><strong>Adresa doručenia:</strong>"; $message .= "<table><tr><td>" . $data["doruc_meno"] . "</td></tr>"; $message .= "<tr><td>" . $data["doruc_adresa"] . "</td></tr>"; $message .= "<tr><td>" . $data["doruc_psc"] . " " . $data["doruc_mesto"] . "</td></tr>"; $message .= "</table><br></td>"; $message .= "</tr></table><br><br>"; $fieldsets_c = count($data_row); for ($i = 0; $i < $fieldsets_c; $i++) { $ks[$i] = $data_row[$i][ks]; $id[$i] = $data_row[$i][id]; $product_type[$i] = $data_row[$i][id_product_type]; $product[$i] = $data_row[$i][id_product]; $product_delivery[$i] = $data_row[$i][id_product_delivery]; $atyp_text[$i] = $data_row[$i][atyp_text]; $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n FROM objednavka_row_atribute \r\n WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\""); //dd($form_data_row_option); foreach ($data_row_option as $option) { $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"]; } $query = "SELECT * from cp_row WHERE id_cp=" . sec_input(sec_sql($_GET["cp"])) . " AND id_objednavka_row=" . $data_row[$i][id] . ""; $cp_row = sql_query($query)[0]; $cena[$i] = $cp_row[cena]; $zlava[$i] = $cp_row[zlava]; //var_dump($cp_row); } $data[id_all] = $id; $data[ks_all] = $ks; $data[product_type_all] = $product_type; $data[product_all] = $product; $data[product_delivery_all] = $product_delivery; $data[atyp_text_all] = $atyp_text; $data[product_atribute_options_all] = $data_rows; $data[product_price_all] = $cena; $data[zlava_all] = $zlava; $message .= "<div class=\"print_hlavicka3\">\r\n <table style=\"font-size: 80%;\" class=\"items\">\r\n <tr style=\"background-color: #efefef; font-size: 9pt;\">\r\n <th></th>\r\n <th style=\"width: 380px;\">produkt</th>\r\n <th style=\"width: 40px;\">množstvo</th>\r\n <th style=\"width: 100px;\">doprava</th> \r\n <th style=\"width: 50px;\">j.cena</th>\r\n <th style=\"width: 50px;\">Spolu</th>\r\n <th style=\"width: 100px;\">zľava %</th>\r\n <th style=\"width: 80px;\">po zľave</th>\r\n </tr>"; //var_dump(sql_query("SELECT * from cp WHERE id=$cp")); //var_dump($data); $fieldsets_c = count($data["ks_all"]); for ($i = 0; $i < $fieldsets_c; $i++) { $poradie = 0; $poradie = $i + 1; $message .= "<tr>\r\n <td class=\"form_poradie\">{$poradie}. </td>\r\n "; $product_type = sql_query("SELECT meno FROM product_type WHERE id=" . sec_sql(sec_input($data["product_type_all"][$i])) . " LIMIT 1"); $product_type = $product_type[0]; $product = sql_query("SELECT id, meno FROM product WHERE id=" . sec_sql(sec_input($data["product_all"][$i])) . " LIMIT 1")[0]; $message .= hidden("id[]", $data["id_all"][$i]); $options_str = array(); //var_dump($data); if (!isset($data["product_atribute_options_all"][$i]) or empty($data["product_atribute_options_all"][$i])) { $data["product_atribute_options_all"][$i] = array(); } $option_c_hladina = 1; foreach ($data["product_atribute_options_all"][$i] as $option) { //var_dump($option); $options = sql_query("SELECT id, meno, id_c_hladina FROM product_atribute_option WHERE id=" . sec_sql(sec_input($option)) . " LIMIT 1"); $options_str[] = $options[0]["meno"]; if ($options[0]["id_c_hladina"] > $option_c_hladina) { $option_c_hladina = $options[0]["id_c_hladina"]; } //$options["price"] = sql_query("SELECT id, cena FROM product_atribute_option WHERE id=".sec_sql(sec_input($option))." LIMIT 1"); } $options_str = empty($options_str) ? "" : " (" . join(", ", $options_str) . ")"; $message .= "<td class=\"form_nazov_siroky\">" . $product_type["meno"] . " " . $product["meno"] . "" . $options_str . "" . (empty($data["atyp_text_all"][$i]) ? "" : "<br>Atyp: " . sec_input($data["atyp_text_all"][$i])) . "</td>"; $product_delivery = sql_query("SELECT meno FROM product_delivery WHERE id=" . sec_sql(sec_input($data["product_delivery_all"][$i])) . " LIMIT 1"); $product_delivery = $product_delivery[0]; $message .= "<td class=\"form_ks\">" . sec_input($data["ks_all"][$i]) . " ks</td>"; $message .= "<td class=\"form_hrana\">" . $product_delivery["meno"] . "</td>"; $message .= hidden("ks[]", $data["ks_all"][$i]); if (empty($data[product_price_all][$i])) { $product_prices = sql_query("SELECT id, cena FROM cp_product WHERE id_c_hladina=" . $option_c_hladina . " AND id_product=" . $product["id"] . " ORDER BY id DESC LIMIT 1")[0]; $product_price = $product_prices[cena]; } else { $product_price = $data[product_price_all][$i]; } $product_ks_sum = $product_ks_sum + sec_input($data["ks_all"][$i]); $product_price_sum = $product_price * sec_input($data["ks_all"][$i]); $message .= hidden("id_cp_product[]", $product_prices[id]); // spocitanie ceny spolu za vsetky produkty $products_prices_sums = $products_prices_sums + $product_price_sum; $zlava_E = $product_price_sum * $data[zlava_all][$i] / 100; $po_zlave = $product_price_sum - $zlava_E; $po_zlave_sum = $po_zlave_sum + $po_zlave; if (!empty($data["atyp_text_all"][$i])) { $product_price = $data[product_price_all][$i] . " €"; } else { $product_price = $product_price . " €"; } $message .= "<td class=\"form_nazov ali-center product-price\">" . $product_price . "</td>"; $message .= "<td class=\"form_nazov ali-center\"><span class=\"cena-spolu-product\">" . $product_price_sum . "</span> €</td>"; $message .= "<td class=\"form_nazov ali-center\"><span class=\"zlava-E bold\">" . ($zlava_E > 0 ? "-" . $zlava_E . " €" : "") . "</span>" . ($data[zlava_all][$i] > 0 ? " (" . $data[zlava_all][$i] . "%)" : "") . "</td>"; $message .= "<td class=\"form_nazov ali-center po-zlave-sum bold\">" . $po_zlave . " €</td>"; $message .= "</tr>"; } $message .= "<tr class=\"cp_spolu bold\">\r\n <td></td>\r\n <td>Spolu:</td>\r\n <td class=\"ali-center\">" . $product_ks_sum . " ks</td>\r\n <td></td>\r\n <td></td>\r\n <td class=\"ali-center\">" . $products_prices_sums . " €</td>\r\n <td></td>\r\n <td class=\"ali-center po-zlave-sum-all\">" . $po_zlave_sum . " €</td>\r\n \r\n <tr>"; $message .= "</table></div>"; $message .= "</table><br><br>"; $message .= "email vytvorený: " . date("j. n. Y - H:i") . "<br>"; $message .= "</body></html>"; mysql_query("COMMIT"); //echo $message; //dd(""); if ($data["email"] != $email_to) { $email_to = $data["email"]; $email_subject = "Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . " / " . $data_obj["rok"] . " - " . def_value("default_firma", "hodnota") . ""; $headers = "From: \"" . def_value("default_firma", "hodnota") . "\" <" . def_value("default_email", "hodnota") . ">\r\n"; $headers .= "Reply-To: " . def_value("default_email", "hodnota") . "\r\n"; //$headers .= "CC: scooti@stonline.sk\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->CharSet = "UTF-8"; $mail->SMTPDebug = 0; $mail->SMTPAuth = true; //$mail->SMTPSecure = 'ssl'; $mail->Host = def_value("default_email_host", "hodnota"); $mail->Port = def_value("default_email_port", "hodnota"); $mail->Username = def_value("default_email_username", "hodnota"); $mail->Password = def_value("default_email_password", "hodnota"); $mail->isHTML(true); $mail->setLanguage('sk', 'language/'); $mail->SetFrom(def_value("default_email", "hodnota"), def_value("default_firma", "hodnota")); $mail->Subject = $email_subject; $mail->Body = $message; $mail->AddAddress($email_to); $mail->Send(); //mail($email_to, $email_subject, $message, $headers); //var_dump($email_to); //var_dump($data["email"]); } echo "Email bol úspešne odoslaný na adresu: {$email_to}"; }
$mail->msgHTML($body); $mail->addAddress($e, 'Parceiro Muda Muda'); if (!$mail->send()) { echo "Mailer Error:" . $mail->ErrorInfo . "<br />"; break; //força a saída do loop em caso de erro } // Limpa os dados para o próximo envio $mail->clearAddresses(); $mail->clearAttachments(); }*/ ////////////////////////////////////////////////////// // envia e-mail de confirmação ao usuário que solicitou o orçamento $mailUser = new PHPMailer(); $mailUser->setLanguage('pt'); $mailUser->isSMTP(); $mailUser->Host = $host; $mailUser->SMTPAuth = true; $mailUser->Username = $username; $mailUser->Password = $password; $mailUser->Port = $port; $mailUser->SMTPSecure = $secure; $mailUser->From = $from; $mailUser->FromName = $fromName; $mailUser->CharSet = 'utf-8'; $mailUser->addAddress($dados['email'], $dados['solicitante']); $mailUser->isHTML(true); //$mailUser->WordWrap = 300; /////////// formatação do e-mail de resposta $body = file_get_contents($templtMailOrcm);
/** * Miscellaneous calls to improve test coverage and some small tests. */ public function testMiscellaneous() { $this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf'), 'MIME TYPE lookup failed'); $this->Mail->addCustomHeader('SomeHeader: Some Value'); $this->Mail->clearCustomHeaders(); $this->Mail->clearAttachments(); $this->Mail->isHTML(false); $this->Mail->isSMTP(); $this->Mail->isMail(); $this->Mail->isSendmail(); $this->Mail->isQmail(); $this->Mail->setLanguage('fr'); $this->Mail->Sender = ''; $this->Mail->createHeader(); $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded'); $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed'); $this->assertTrue($this->Mail->set('AllowEmpty', null), 'Null property set failed'); $this->assertTrue($this->Mail->set('AllowEmpty', false), 'Valid property set of null property failed'); //Test pathinfo $a = '/mnt/files/飛兒樂 團光茫.mp3'; $q = PHPMailer::mb_pathinfo($a); $this->assertEquals($q['dirname'], '/mnt/files', 'UNIX dirname not matched'); $this->assertEquals($q['basename'], '飛兒樂 團光茫.mp3', 'UNIX basename not matched'); $this->assertEquals($q['extension'], 'mp3', 'UNIX extension not matched'); $this->assertEquals($q['filename'], '飛兒樂 團光茫', 'UNIX filename not matched'); $this->assertEquals(PHPMailer::mb_pathinfo($a, PATHINFO_DIRNAME), '/mnt/files', 'Dirname path element not matched'); $this->assertEquals(PHPMailer::mb_pathinfo($a, 'filename'), '飛兒樂 團光茫', 'Filename path element not matched'); $a = 'c:\\mnt\\files\\飛兒樂 團光茫.mp3'; $q = PHPMailer::mb_pathinfo($a); $this->assertEquals($q['dirname'], 'c:\\mnt\\files', 'Windows dirname not matched'); $this->assertEquals($q['basename'], '飛兒樂 團光茫.mp3', 'Windows basename not matched'); $this->assertEquals($q['extension'], 'mp3', 'Windows extension not matched'); $this->assertEquals($q['filename'], '飛兒樂 團光茫', 'Windows filename not matched'); }