<div dir="ltr">I&#39;ll add that you should look into a transactional email partner like sendgrid, mailgun, etc.  They&#39;ll help you stay out of the  black lists by showing you what not to do, ans how to set up DKIM, etc. for authentication of your email.<div><br></div><div><br></div><div>I use sendgrid professionally, with one of my cusotmers that sends a lot of email.</div><div><br><div>If your volume is under 10k emails per month, sendgrid is free, and they have a templating feature which allows you to upload a template (parameterizable) and let them to the mail merge on their servers, for up to one thousand addresses per tx.</div><div><br></div><div>So instead of generating 3000 emails and pushing them through your smtp server, you&#39;d upload the template file, and push three 1000-name lists to to sendgrid and let them take care of delivery.  Something to think about.</div><div><br></div><div>Len.</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 12:38 PM, Lasse Makholm <span dir="ltr">&lt;<a href="mailto:lasse@unity3d.com" target="_blank">lasse@unity3d.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Maybe not the answer you&#39;re looking for but I&#39;d go with an email service such as sendgrid which takes most if not all of the pain out of sending emails. They have a simple REST API you can POST your email to and provides callbacks for delivery notifications etc as well...<div><br></div><div>I&#39;m not advocating sendgrid over any other service (I&#39;m sure there are plenty others) - it&#39;s just the one I have experience with... They apparently have a free tier as well....<span class="HOEnZb"><font color="#888888"><br><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">/L</font></span><div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 5:53 PM, Octavian Rasnita <span dir="ltr">&lt;<a href="mailto:orasnita@gmail.com" target="_blank">orasnita@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>





<div bgcolor="#ffffff">
<div><font size="2" face="Arial">A queue in Perl is better when there is a need of 
sending thousand messages.</font></div>
<div><font size="2" face="Arial">Without a queue, if the Catalyst-based code just 
sends the messages directly and a browser is waiting for a page to load after 
the web app sent them, it may time-out. But otherwise it should work and not 
crash the web app.</font></div>
<div><font size="2" face="Arial">3000 messages should be sent pretty fast if they 
are sent to the local SMTP server, but not fast enough for a pleasant 
experience.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Regarding the success of those messages... if you 
don&#39;t want them to reach in the spam folder, it helps to sign them by using 
SPF/DKIM. If you&#39;ll find this complicated, a</font><font size="2" face="Arial"> 
better solution might be to create an account on a site like <a href="http://mailgun.com" target="_blank">mailgun.com</a> or 
<a href="http://mandrill.com" target="_blank">mandrill.com</a> and send the messages using their servers. They offer APIs that you 
can use in your app very easy. <a href="http://mailgun.com" target="_blank">mailgun.com</a> allows sending 10,000 messages/month 
for free and after that limit the prices are pretty cheap. You will have reports 
with the list of email messages that bounced that you can get programaticly, 
plus a few other helpful features.</font></div><span><font color="#888888">
<div><font size="2" face="Arial"></font> </div>
<div>--Octavian<br></div>
</font></span><blockquote style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;PADDING-RIGHT:0px;MARGIN-RIGHT:0px"><div><div>
  <div style="FONT:10pt arial">----- Original Message ----- </div>
  <div style="BACKGROUND:#e4e4e4;FONT:10pt arial"><b>From:</b> 
  <a title="catalystgroup@unitedgames.co.uk" href="mailto:catalystgroup@unitedgames.co.uk" target="_blank">Andrew</a> </div>
  <div style="FONT:10pt arial"><b>To:</b> <a title="catalyst@lists.scsys.co.uk" href="mailto:catalyst@lists.scsys.co.uk" target="_blank">The elegant MVC web framework</a> 
  </div>
  <div style="FONT:10pt arial"><b>Sent:</b> Thursday, November 26, 2015 5:32 
  PM</div>
  <div style="FONT:10pt arial"><b>Subject:</b> [Catalyst] Sending 3000 
  emails.</div>
  <div><br></div>
  <div><font size="2">Hello,</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">You lot are all experts at Catalyst and Perl,</font></div>
  <div><font size="2">and because I&#39;m using Perl to code a Catalyst program, I 
  wanted to ask you about a problem I&#39;ve encountered.</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">The Catalyst app I&#39;m coding is to replace a PHP website, 
  which presently allows an admin to manage sending out an email to all members. 
  The site has 3000 odd members. From what I could tell, the PHP code was simply 
  using the PHP mail function to send email (although it did in my experience 
  typically take two days for everyone to receive an email sent with 
  it).</font></div>
  <div><font size="2">I&#39;ve also been asking other Perl programmers when I&#39;ve had 
  the chance - and the only concerns raised, were about IP blacklisting or 
  emails bouncing back - not about actual code working.</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">So could sending 3000 emails be as simple as Matt&#39;s 
  old CGI form mail?</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">I had a look on CPAN, and found the simple looking 
  Email::Stuffer,</font></div>
  <div><font size="2">and wrote a script, sending an email to myself, and it 
  worked.</font></div>
  <div><font size="2">I then modified the script to pick five email addresses from 
  a MySQL database, and email them, and again - it worked.</font></div>
  <div><font size="2">Okay - one final change - throwing 3000 email 
  addresses at it.</font></div>
  <div><font size="2">How does that do....?</font></div>
  <div><font size="2">Starts to work - then throws up an Internal Server 
  Error in the browser window,</font></div>
  <div><font size="2">and I find out my Fast CGI Plack Up server thingie isn&#39;t up, 
  nor running my Catalyst app anymore.</font></div>
  <div><font size="2">I have to type plackup and my details, etc, again from the 
  command prompt.</font></div>
  <div><font size="2">A log in to Web Host Manager (this is an apache2 VPS with 
  CPanel) and a check of the &quot;View Sent Summary&quot; shows 1020 emails sent - 611 
  successful, 642 deferrals and 329 failures...curious, as that adds 
  up to more than 1020, =S. If I click through for more details, it shows 1582 
  records - some with green ticks, and others with amber or red exclamation 
  marks, ^_^.</font></div>
  <div><font size="2">I can worry about IPs and failure rates 
  later....</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">....I just want to know why the whole FastCGI Plack loaded 
  Catalyst app came down half way through,</font></div>
  <div><font size="2">and how I can have a Perl script process sending 3000 emails 
  without that happening every time, =S.</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">Do I need to use a queue within Perl? Or does the 
  postfix/sendmail on the server, automatically queue everything for me? If so - 
  why did my code crash the Catalyst app, and not send all the 
  emails? &gt;_&lt;.</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">I&#39;m guessing this is a common problem - how does a website 
  email all its signed up members - and so there must surely be a common 
  solution among Perl / Catalyst users....?</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">Any help, appreciated!</font></div>
  <div><font size="2"></font> </div>
  <div><font size="2">Yours,</font></div>
  <div><font size="2">Andrew.</font></div>
  <div><font size="2"></font> </div>
  </div></div><p>
  </p><hr><span>

  <p></p>_______________________________________________<br>List: 
  <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>Listinfo: 
  <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>Searchable 
  archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>Dev site: 
  <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br></span><p></p></blockquote></div>
<br>_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" rel="noreferrer" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" rel="noreferrer" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" rel="noreferrer" target="_blank">http://dev.catalyst.perl.org/</a><br>
<br></blockquote></div><br></div></div></div></div></div></div>
<br>_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" rel="noreferrer" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" rel="noreferrer" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" rel="noreferrer" target="_blank">http://dev.catalyst.perl.org/</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Len Jaffe - Information Technology Smoke Jumper - <a href="mailto:lenjaffe@jaffesystems.com" target="_blank">lenjaffe@jaffesystems.com</a> </div><div>614-404-4214    <a href="https://www.twitter.com/lenJaffe" target="_blank">@LenJaffe</a>  <a href="http://www.lenjaffe.com/" target="_blank">www.lenjaffe.com</a><br></div><div>Host of <a href="http://www.meetup.com/techlifecolumbus/" target="_blank">Code Jam Columbus</a>  - <a href="https://www.twitter.com/CodeJamCMH" target="_blank">@CodeJamCMH</a></div><div><div>Curator of <a href="http://www.lenjaffe.com/AdventPlanet/" target="_blank">Advent Planet</a> - An Aggregation of Online Advent Calendars.<div><br></div></div></div></div></div></div></div></div></div>
</div>