html - PHP mail has empty body under certain conditions -


OK, I created the following function and I'm using it for a while:

  / ** * Email Sender receives an HTML email with an attachment from the name * Sender name * @ from the absolute string $ Sender's email * @ from the absolute string $ @ String $ theme e-mail subject line * @ Ultimate String $ message message message * @ Ultimate Array $ file name (with path) * @ Ultimate String $ answer where answer * The ultimate boolean $ $ if the message is sent to the mail, should be sent as plain text and not html * @ Return boolean $ success TRUE * / function mail_attachment ($ mailto, $ from_mail, $ From_name, $ subject, $ messageText, $ files = array (), $ answerto = '', $ isPlain = FALSE, $ charset = 'iso-8859-1') {if ($ answerto == '') {$ answerto = $ From_mail; } $ MessageType = ($ isPlain? 'Plain': 'html'); $ Border = '== Multipart_boundary_x' MD5 (Unicode (time ()) 'X'; $ Header = 'From:' $ to_name '& lt;' . $ From_mail '& gt;' . Left; $ Header = 'Reply:' $ Answer LF; $ Header = 'MIME-Version: 1.0' Lf; $ Header = 'Content-type: multipart / mixed; Border = "'. $ Border.' '; $ Message =' This MIME format has multi-part message 'LF Left; $ message. =' - '. $ Limit Left; $ message. =' Content-type: Text / '$ message type'; Charset = "'. $ Charset. ' '' Left; $ Message = 'Content-Transfer-Encoding: 7bit' LF Left; $ Message = $ Message text LF Left; Foreign currency (dollar files as $$) {if (is_file ($ file)) {$ message = '-' $ border left; $ Name = basename ($ file); $ File_size = filesize ($ file); $ Type = substr (strrchr ($ file, "."), 1) ;; $ Handle = fopen ($ file, "R"); $ Content = fread ($ handle, $ file_size); Fclose ($ handle); $ Content = chunk_split (base64_encode ($ content)); $ Message = 'Content-type: app /' $ type '; Name = "'. $ Name' '' '' '' '' '' '' '' '' '' '' '' '' '' $ name '' ''. Name = "'. $ Name '' ''. LF Left; $ Message = $ Content LF LF; }} Message. = '-' $ range '-'; Return Mail ($ Mail, $ theme, $ message, $ header); }  

Now I used an intranet system, where one monthly quronose should send different HTML mails for more than 400 users. I tested it with the place of receiver chosen with my own address and I got all 400 mails with personal content. I also tested with a condition that sent e-mails, if the name was in the whitelist, to ensure that they come through internal systems. All went well until the final release. Now all 400 recipients have received an empty e-mail with just the subject and header.

Now I'm thinking of storing all the mails in a temporary table and selecting smaller knit (with every 5 minutes) that they send to another chronose.

What happened to you and perhaps there is an explanation for another solution? thank you in advanced.


Comments