X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fmail.phh;h=30b8dbaebaf1dbcd82e727c84325c579018b6b9b;hb=b07b702ce4c2f769d4bb948d9f95f660c21baf73;hp=d0d6ea726106173bf75a277b81a36f862d218c57;hpb=a14d9d7ed95e0ad85851e423d4d3295b00e35d2b;p=brisk.git diff --git a/web/Obj/mail.phh b/web/Obj/mail.phh index d0d6ea7..30b8dba 100644 --- a/web/Obj/mail.phh +++ b/web/Obj/mail.phh @@ -1,36 +1,58 @@ "utf-8", - "html_charset" => "utf-8", - "header_charset" => "utf-8", - "eol" => "\n" ); +if (isset($argv) && __FILE__ == realpath($argv[0])) { + $G_base = "web/"; +} +require_once("${G_base}Obj/class.phpmailer.php"); -// references: @ function brisk_mail($to, $subject, $text, $html) { - GLOBAL $brisk_mail_hp, $G_admin_mail; + GLOBAL $G_admin_mail; + + $mail = new PHPMailer(TRUE); + $mail->CharSet = "UTF-8"; + + $mail->From = $G_admin_mail; + $mail->FromName = 'Brisk Admin'; + $mail->addAddress($to); // Add a recipient + $mail->addReplyTo($G_admin_mail, 'Brisk Admin'); + + $mail->Subject = $subject; + $mail->AltBody = $text; + + $body_html = sprintf("%s%s", + $subject, $html); + + $mail->MsgHTML($body_html); + + + return ($mail->Send()); +} + - $hdrs = array( - 'From' => $G_admin_mail, - 'Subject' => $subject - ); - // if ($refs != Null) - // $hdrs['References'] = $refs; +if (isset($argv) && __FILE__ == realpath($argv[0])) { + $G_admin_mail = "brisk@alternativeoutput.it"; - $mime = new Mail_mime($brisk_mail_hp); + $to = "brisk@alternativeoutput.it"; + $subject = "Brisk: credenziali di accesso."; + $body_txt = "Ciao, sono l' amministratore del sito di Brisk. - $mime->setTXTBody($text); - $mime->setHTMLBody($html); +La verifica del tuo indirizzo di posta elettronica e del tuo nickname è andata a buon fine, per accedere al sito +d'ora in poi potrai utilizzare l' utente 'mopz' e la password 'ienxedsiyndo'. - $body = $mime->get(); - $hdrs = $mime->headers($hdrs); +Benvenuto e buone partite, mop."; + $body_htm = "Ciao, sono l' amministratore del sito di Brisk.

+La verifica del tuo indirizzo di posta elettronica e del tuo nickname è andata a buon fine, per accedere al sito d'ora in poi potrai usare l' utente 'mopz' e la password 'ienxedsiyndo'.
+Benvenuto e buone partite, mop.
"; - $mail = Mail::factory('mail'); + $body_htm_full = sprintf("%s%s", + $subject, $body_htm); - $mail->send($to, $hdrs, $body); - return TRUE; + if (brisk_mail("brisk@alternativeoutput.it", $subject, $body_txt, $body_htm)) { + echo "SUCCESS"; + } + else { + echo "ERROR"; + } } -?> \ No newline at end of file +?>