<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.stephanschlegel.de/index.php?action=history&amp;feed=atom&amp;title=Ghetto_Mailer</id>
	<title>Ghetto Mailer - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.stephanschlegel.de/index.php?action=history&amp;feed=atom&amp;title=Ghetto_Mailer"/>
	<link rel="alternate" type="text/html" href="https://wiki.stephanschlegel.de/index.php?title=Ghetto_Mailer&amp;action=history"/>
	<updated>2026-05-06T19:02:13Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikizone</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.stephanschlegel.de/index.php?title=Ghetto_Mailer&amp;diff=23538&amp;oldid=prev</id>
		<title>Steff: Die Seite wurde neu angelegt: „Ryans sehr alte Lösung für einfachen E-Mail Versand (genutzt bis 2013). Inzwischen nutzt Ryan ProcessWire Seiten und versendet über  directly from this serv…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.stephanschlegel.de/index.php?title=Ghetto_Mailer&amp;diff=23538&amp;oldid=prev"/>
		<updated>2019-01-19T11:23:03Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „Ryans sehr alte Lösung für einfachen E-Mail Versand (genutzt bis 2013). Inzwischen nutzt Ryan ProcessWire Seiten und versendet über  directly from this serv…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Ryans sehr alte Lösung für einfachen E-Mail Versand (genutzt bis 2013). Inzwischen nutzt Ryan ProcessWire Seiten und versendet über  directly from this server using PW&amp;#039;s WireMail interface with either Teppo&amp;#039;s WireMailSwiftMailer or Horst&amp;#039;s WireMailSMTP. ﻿Interessant bei untenstehender Lösung: durch das 3 Sekunden Intervall gab es wohl niemals Probleme. Bis zu einer gewissen Menge sicher ausreichend.&lt;br /&gt;
&lt;br /&gt;
Quelle: https://processwire.com/talk/topic/3433-newsletter-system-for-pw/&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m embarrassed to admit that I send them myself, using a script I wrote more than a decade ago. It&amp;#039;s always worked fine, so I&amp;#039;ve just stuck with it. But I agree with the guys that say it&amp;#039;s better to use a service. Someday I will take that advice myself too. But if you want to use what I&amp;#039;m using, here you go…&lt;br /&gt;
&lt;br /&gt;
First you&amp;#039;ll need a text file with your subscribers in it. 1 email address per line. It can be only a few, or it can be thousands. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;subscribers.txt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 bob@email.com&lt;br /&gt;
 jim@bigcompany.com&lt;br /&gt;
 mike@little-org.com&lt;br /&gt;
&lt;br /&gt;
Now you&amp;#039;ll need the email content. You&amp;#039;ll want 1 HTML file and 1 text file. Both should have the same content:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;template.html&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;test email&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This is a test email&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;template.txt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 TEST&lt;br /&gt;
 This is a test email&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;email.php&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Place this PHP file in the same directory as the above files. Edit the DEFINEs at the top as necessary. I apologize in advance for this rather awful email solution, but hey it works, and that&amp;#039;s why I haven&amp;#039;t bothered to rewrite it in 10 years. :) To run, place the files on a web server and then load in your browser. It should start emailing immediately, once every 3 seconds. If you are sending thousands, then it might take several hours. But because it sends slow, it never seems to caught up in any filters. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php&lt;br /&gt;
     &lt;br /&gt;
    /**&lt;br /&gt;
     * GhettoMailer v1.0 &lt;br /&gt;
     *&lt;br /&gt;
     * © 1994 by Ryan Cramer&lt;br /&gt;
     *&lt;br /&gt;
     */&lt;br /&gt;
     &lt;br /&gt;
    define(&amp;quot;NAME_FROM&amp;quot;,     &amp;#039;&amp;quot;Your Name Here&amp;quot;&amp;#039;);&lt;br /&gt;
    define(&amp;quot;EMAIL_FROM&amp;quot;,    &amp;quot;you@domain.com&amp;quot;);&lt;br /&gt;
    define(&amp;quot;REPLY_TO&amp;quot;,      &amp;quot;you@domain.com&amp;quot;);&lt;br /&gt;
    define(&amp;quot;ERRORS_TO&amp;quot;,     &amp;quot;you@domain.com&amp;quot;);&lt;br /&gt;
    define(&amp;quot;SUBJECT&amp;quot;,       &amp;quot;ProcessWire News &amp;amp; Updates - April/May 2013&amp;quot;);&lt;br /&gt;
     &lt;br /&gt;
    define(&amp;quot;SECONDS&amp;quot;, 3); // seconds delay between each email sent&lt;br /&gt;
    define(&amp;quot;TEXT_ONLY&amp;quot;, false); // set to true if not sending HTML email&lt;br /&gt;
    define(&amp;quot;TEST_MODE&amp;quot;, false); // set to true if just testing a send&lt;br /&gt;
    define(&amp;quot;TEST_MODE_EMAIL&amp;quot;, &amp;quot;you@domain.com&amp;quot;); // email to send to when testing&lt;br /&gt;
    define(&amp;quot;SUBSCRIBERS_FILE&amp;quot;, &amp;quot;subscribers.txt&amp;quot;); // file containing subscribers, 1 email per line&lt;br /&gt;
    define(&amp;quot;TEMPLATE&amp;quot;, &amp;quot;template&amp;quot;); // file containing email to send: template.html and template.txt&lt;br /&gt;
    define(&amp;quot;X_MAILER&amp;quot;, &amp;quot;GhettoMailer 1.0&amp;quot;); &lt;br /&gt;
     &lt;br /&gt;
    /**************************************************************************************/&lt;br /&gt;
     &lt;br /&gt;
    ini_set(&amp;quot;auto_detect_line_endings&amp;quot;, true);&lt;br /&gt;
     &lt;br /&gt;
    function mailTextHtml($to, $subject, $message_text, $message_html, $headers) {&lt;br /&gt;
      // exactly like regular mail function except sends both text and html versions&lt;br /&gt;
      &lt;br /&gt;
      $semi_rand = md5(time());&lt;br /&gt;
      $mime_boundary = &amp;quot;==Multipart_Boundary_x{$semi_rand}x&amp;quot;;&lt;br /&gt;
      $headers = trim($headers); // in case there is a trailing newline&lt;br /&gt;
      &lt;br /&gt;
      $headers .=               &lt;br /&gt;
        &amp;quot;\nX-Mailer: &amp;quot; . X_MAILER . &amp;quot;\n&amp;quot; .&lt;br /&gt;
        &amp;quot;MIME-Version: 1.0\n&amp;quot; .&lt;br /&gt;
        &amp;quot;Content-Type: multipart/alternative;\n  boundary=\&amp;quot;$mime_boundary\&amp;quot;&amp;quot;;&lt;br /&gt;
      &lt;br /&gt;
      $message = &lt;br /&gt;
        &amp;quot;This is a multi-part message in MIME format.\n\n&amp;quot; .&lt;br /&gt;
        &amp;quot;--{$mime_boundary}\n&amp;quot; .&lt;br /&gt;
        &amp;quot;Content-Type: text/plain; charset=\&amp;quot;utf-8\&amp;quot;\n&amp;quot; .&lt;br /&gt;
        &amp;quot;Content-Transfer-Encoding: 7bit\n\n&amp;quot; .&lt;br /&gt;
        &amp;quot;$message_text\n\n&amp;quot; .&lt;br /&gt;
        &amp;quot;--{$mime_boundary}\n&amp;quot; .&lt;br /&gt;
        &amp;quot;Content-Type: text/html; charset=\&amp;quot;utf-8\&amp;quot;\n&amp;quot; .&lt;br /&gt;
        &amp;quot;Content-Transfer-Encoding: 7bit\n\n&amp;quot; .&lt;br /&gt;
        &amp;quot;$message_html\n\n&amp;quot; .&lt;br /&gt;
        &amp;quot;--{$mime_boundary}--\n&amp;quot;;&lt;br /&gt;
      &lt;br /&gt;
      $success = @mail($to, $subject, $message, $headers, &amp;quot;-f&amp;quot; . ERRORS_TO);&lt;br /&gt;
      return $success;&lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    /**************************************************************************************/&lt;br /&gt;
     &lt;br /&gt;
    $start = 0;&lt;br /&gt;
    if(!empty($_GET[&amp;#039;start&amp;#039;])) $start = (int) $_GET[&amp;#039;start&amp;#039;];&lt;br /&gt;
     &lt;br /&gt;
    $subscribers = file(SUBSCRIBERS_FILE);&lt;br /&gt;
     &lt;br /&gt;
    if(isset($subscribers[$start])) {&lt;br /&gt;
      &lt;br /&gt;
      $line = trim($subscribers[$start]);&lt;br /&gt;
      $total = count($subscribers)-1;  &lt;br /&gt;
      $email = trim($line);&lt;br /&gt;
      $subject = SUBJECT;&lt;br /&gt;
      &lt;br /&gt;
      if(isset($_GET[&amp;#039;pause&amp;#039;])) {&lt;br /&gt;
        $meta = &amp;#039;&amp;#039;;&lt;br /&gt;
        $content = &amp;quot;[$start/$total] Paused. &amp;lt;a href=\&amp;quot;email.php?start=$start\&amp;quot;&amp;gt;Resume&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
      } else {&lt;br /&gt;
     &lt;br /&gt;
        $meta = &amp;#039;&amp;lt;META HTTP-EQUIV=Refresh CONTENT=&amp;quot;&amp;#039; . SECONDS . &amp;#039;; URL=./email.php?start=&amp;#039; . ($start+1) . &amp;#039;&amp;quot;&amp;gt;&amp;#039;;&lt;br /&gt;
     &lt;br /&gt;
        $content =   &lt;br /&gt;
          &amp;quot;[$start/$total] Emailing &amp;lt;u&amp;gt;$email&amp;lt;/u&amp;gt;&amp;lt;br /&amp;gt;&amp;quot; .&lt;br /&gt;
          &amp;#039;&amp;lt;a href=&amp;quot;email.php?pause=1&amp;amp;start=&amp;#039; . ($start+1) . &amp;#039;&amp;quot;&amp;gt;Pause&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;;&lt;br /&gt;
     &lt;br /&gt;
        if(TEST_MODE) $email = TEST_MODE_EMAIL;&lt;br /&gt;
     &lt;br /&gt;
        $headers =   &lt;br /&gt;
          &amp;quot;From: &amp;quot; . NAME_FROM . &amp;quot; &amp;lt;&amp;quot; . EMAIL_FROM . &amp;quot;&amp;gt;\n&amp;quot; .&lt;br /&gt;
          &amp;quot;Reply-To: &amp;quot; . REPLY_TO . &amp;quot;\n&amp;quot; .&lt;br /&gt;
          &amp;quot;Errors-To: &amp;quot; . ERRORS_TO;&lt;br /&gt;
     &lt;br /&gt;
        $content .= &amp;quot;Subject: &amp;lt;b&amp;gt;$subject&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
        $bodyText = file_get_contents(TEMPLATE . &amp;quot;.txt&amp;quot;);&lt;br /&gt;
     &lt;br /&gt;
        if(TEXT_ONLY) {&lt;br /&gt;
          mail($email, $subject, $bodyText, $headers, &amp;quot;-f&amp;quot; . ERRORS_TO);&lt;br /&gt;
     &lt;br /&gt;
        } else {&lt;br /&gt;
          $bodyHtml = file_get_contents(TEMPLATE . &amp;#039;.html&amp;#039;); &lt;br /&gt;
          mailTextHtml($email, $subject, $bodyText, $bodyHtml, $headers); &lt;br /&gt;
        }&lt;br /&gt;
     &lt;br /&gt;
        $handle = fopen(&amp;quot;email.log&amp;quot;, &amp;quot;a&amp;quot;);&lt;br /&gt;
        if($handle) {&lt;br /&gt;
          fwrite($handle, &amp;quot;[$start/$total]: $email\n&amp;quot;);&lt;br /&gt;
          fclose($handle);&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
     &lt;br /&gt;
    } else {&lt;br /&gt;
      $meta = &amp;#039;&amp;#039;;&lt;br /&gt;
      $content = &amp;quot;Subscriber emailing finished. $start emails sent.&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    ?&amp;gt;&lt;br /&gt;
    &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;?=$meta; ?&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;?=$content; ?&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steff</name></author>
	</entry>
</feed>