<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023535" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023535</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144880</link>
    <description> &lt;p&gt;I know a number of ISPs will block huge lists of BCCs as well, or terminate them at 150 or some arbitrary number. &lt;/p&gt;
&lt;p&gt;I&#039;m also leery of BCCs and somewhat guilty of emphasizing dynamic content so I don&#039;t have to deal with them... &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 23 Jan 2004 14:29:35 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1144880 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144871</link>
    <description> &lt;p&gt;m3rajk, my math is indeed flawed, as I noted in one of my responses to Suzanne above: &lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;I said:&lt;/em&gt;&lt;br /&gt;
Suzanne, I was referring to Renegade&#039;s flawed code, which appends an address to the $sendto string, then sends out a set of mails, then appends the next address to $sendto, and then mails once again to the new set. I oversimplified the math so as not to break into this algorithm... it actually sends 200 emails to the first person, 199 to the second, 198 to the third . . . 1 to the last. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I don&#039;t know how else to send in the case of a dynamic body. Is there no way to construct an array of messages in PHP and send it all to the MTA once and have it mail each to a different address?&lt;/p&gt;
&lt;p&gt;How are mails sent to really large lists of addresses in &quot;industrial&quot; situations? I guess some kind of third party software is used?&lt;/p&gt;
 </description>
     <pubDate>Fri, 23 Jan 2004 09:59:23 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1144871 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144861</link>
    <description> &lt;p&gt;If the body of the email is different for each recipient, then you need one mail() call per recipient.&lt;/p&gt;
 </description>
     <pubDate>Fri, 23 Jan 2004 07:25:05 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1144861 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144824</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Abhishek Reddy wrote:&lt;/strong&gt; As I understand it...&lt;/p&gt;
&lt;p&gt; Suppose there are 200 addresses in the db to send to, the looping code with the stringed addresses will have the server send 200 mails out, 200 times (because the loop repeats it for each address in the db). 200*200 = 40,000. And since it sends to the same addresses, 200 people will theoretically end up with 200 copies of the same email in their inbox.&lt;/p&gt;
&lt;p&gt; Why the server breaks is because the PHP mail() function is reasonably inefficient. For the reason that it opens a connection to the Mail Transfer Agent, sends the required mail data to the MTA, then closes the connection. This is fine for sending a few emails, or even for sending a list of emails for the MTA to parse and handle. But with the code in question, it means it will open a connection, send 200 addresses to send to and close the connection (this is fine), but repeat it 200 times (this is not fine).&lt;/p&gt;
&lt;p&gt; As noted in the user comments on the &lt;a href=&quot;http://nz2.php.net/manual/en/ref.mail.php&quot; class=&quot;bb-url&quot;&gt;ref.mail&lt;/a&gt; and &lt;a href=&quot;http://nz2.php.net/manual/en/function.mail.php&quot; class=&quot;bb-url&quot;&gt;function.mail&lt;/a&gt; pages on php.net, opening a single socket with the MTA to send multiple mails out is more efficient. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;either i&#039;m reading the code wrong, or your math is wrong.&lt;/p&gt;
&lt;p&gt;i&#039;m reading that in the one with the mail  in the loop it adds an address with each loop, thus if there is 200 name,s the first gets 200 emails, the second 199, and thus down to the 200th gets one.&lt;/p&gt;
&lt;p&gt;however i also see the point of what suzanne said about the dynamic body, in which case merely changing the script to reset the to feild should make it 200 emails flat int hat situation. and in that cas, do you have a way to send 200 different emails in one call? or would one need to make all 200  calls to the mail function?&lt;/p&gt;
&lt;p&gt;personally if everything else was static, i&#039;d build the mailing list as a bcc and send it once with myself in the to feild so that no recipient would see the others, thus protecting privacy&lt;/p&gt;
 </description>
     <pubDate>Thu, 22 Jan 2004 18:21:15 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1144824 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144821</link>
    <description> &lt;p&gt;Ok, so maybe I didn&#039;t deep enough for some of you. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From what I&#039;ve read: yes, yes, and &quot;that can&#039;t be true!&quot; (disbelief)&lt;/p&gt;
&lt;p&gt;I didn&#039;t read the entire RFC, but I think Appendix B is describing how to handle TO, CC, and BCC headers.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; It is recommended that the UA provide its initial (&amp;quot;submission&lt;br /&gt;&amp;nbsp;&amp;nbsp; client&amp;quot;) MTA with an envelope separate from the message itself.&lt;br /&gt;&amp;nbsp;&amp;nbsp; However, if the envelope is not supplied, SMTP commands SHOULD be&lt;br /&gt;&amp;nbsp;&amp;nbsp; generated as follows:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1. Each recipient address from a TO, CC, or BCC header field SHOULD&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; be copied to a RCPT command (generating multiple message copies if&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; that is required for queuing or delivery).&amp;nbsp; This includes any&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addresses listed in a RFC 822 &amp;quot;group&amp;quot;.&amp;nbsp; Any BCC fields SHOULD then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; be removed from the headers.&amp;nbsp; Once this process is completed, the&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remaining headers SHOULD be checked to verify that at least one&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To:, Cc:, or Bcc: header remains.&amp;nbsp; If none do, then a bcc: header&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with no additional information SHOULD be inserted as specified in&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [32].&lt;/code&gt;&lt;/div&gt;&#039;I have the impression that after the MTA recieves a full envelope, it scans the email headers in the DATA section for CC and BCC recipients.   Then sends copies of the envelope out to each CC and BCC address (leaving out the BCC headers).&lt;/p&gt;
 </description>
     <pubDate>Thu, 22 Jan 2004 17:36:20 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1144821 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144757</link>
    <description> &lt;p&gt;Mark, I didn&#039;t get a word of that. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt; Is this correct?&lt;br /&gt;
 - MAIL command initiates a transaction&lt;br /&gt;
 - RCPT does what? Identify a single primary recipient?&lt;br /&gt;
 - DATA contains headers which are sent to the RCPT recipient? So one recipient gets all the headers?&lt;/p&gt;
&lt;p&gt; At what point are the CC/BCC headers actually processed?&lt;/p&gt;
 </description>
     <pubDate>Wed, 21 Jan 2004 08:32:15 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1144757 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144754</link>
    <description> &lt;p&gt;I&#039;ve always avoided use of the BCC header in mail scripts.  This is because of several (dated) documents that I have read that suggest that the BCC header is not fully and uniformally supported.  I suppose the determining factor would be the MTA that you use to initially send out the email, but I have not done any in-depth investigation.&lt;/p&gt;
&lt;p&gt;I also recently read that the To, Cc, and Bcc headers have nothing to do with determining where an email is sent to.  But that the destination si determined in the SMTP negotiation through the RCPT command.&lt;/p&gt;
&lt;p&gt;Imagine a 15 minute intermission while I run to the &lt;a href=&quot;http://rfc-editor.org/&quot; class=&quot;bb-url&quot;&gt;RFC Editor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ah ha!  I found it in Seciont 3.3 &quot;Mail Transactions&quot; of &lt;a href=&quot;ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt&quot; class=&quot;bb-url&quot;&gt;RFC 2821&lt;/a&gt;.  Basically, there is an &quot;envelope&quot; which includes a MAIL command (&quot;tells the SMTP-receiver that a new mail transaction is starting&quot;), a RCPT command (&quot;a forward-path identifying one recipient&quot;), then a DATA command.  The DATA command contains all information which will be sent to the address identified in the RCPT call.  This data also includes the headers of the email (to, cc, bcc, etc.).&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: When RFC 822 format [7, 32] is being used, the mail data include the&lt;br /&gt;
   memo header items such as Date, Subject, To, Cc, From.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I may have dug deaper than necessary.  If your scripts work, pay no attention to my bcc phobia. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 21 Jan 2004 07:28:56 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1144754 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144750</link>
    <description> &lt;p&gt;*understanding dawns*&lt;/p&gt;
&lt;p&gt;Thank you, Abhi! I feel much less confused. It&#039;s a bad day when you think you know something, then start doubting yourself. Two Mondays in a row. *sigh*&lt;/p&gt;
 </description>
     <pubDate>Wed, 21 Jan 2004 06:31:55 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1144750 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144748</link>
    <description> &lt;p&gt;Suzanne, I was referring to Renegade&#039;s flawed code, which appends an address to the $sendto string, then sends out a set of mails, then appends the next address to $sendto, and then mails once again to the new set. I oversimplified the math so as not to break into this algorithm... it actually sends 200 emails to the first person, 199 to the second, 198 to the third . . . 1 to the last. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt; As for efficiency, all reports I&#039;ve read regarding this indicate that opening a single socket with the MTA (usually sendmail) is more efficient than using mail() repeatedly. I don&#039;t have first-hand experience with this so I can&#039;t say for myself. I objected to using a repeating mail() script in Renegade&#039;s loop since that would send out additional unnecessary mails... which could be dangerous.&lt;/p&gt;
&lt;p&gt;  Last comment on this page: &lt;a href=&quot;http://nz2.php.net/manual/en/function.mail.php&quot; class=&quot;bb-url&quot;&gt;http://nz2.php.net/manual/en/function.mail.php&lt;/a&gt; (&lt;strong&gt;lit at matches dot com[b])&lt;/strong&gt;[/b] as well as the script you quoted, Suzanne.&lt;/p&gt;
 </description>
     <pubDate>Wed, 21 Jan 2004 05:46:15 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1144748 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sending-email-through-php-using-db#comment-1144740</link>
    <description> &lt;p&gt;IMO using BCC is better because it recipients won&#039;t be able to get the email adresse of other recipients spammer register themself to mailling list just to get emails. Server wise it make no difference.&lt;/p&gt;
 </description>
     <pubDate>Tue, 20 Jan 2004 21:26:45 +0000</pubDate>
 <dc:creator>druagord</dc:creator>
 <guid isPermaLink="false">comment 1144740 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
