@ngelot Posted June 27, 2007 Share Posted June 27, 2007 This is my mail-script: <? $body = "<div style=margin:0px;padding:0px;background-image:url(http://www.domain.no/images/headerlogo.png);background-position:left;background-repeat:no-repeat;height:70px;color:ffffff;font-size:1px;>Dersom du ikke ser denne meldingen korrekt, vil du finne samme informasjon på http://www.domain.no.<br /><br /></div><table width=600 cellpadding=0 cellspacing=10 border=0 style=border-style:solid;border-width:1px;border-color:#000000;padding:0px;margin:0px;font-family:arial;text-align:left;font-size:14px;><tr align=left><td width=100% valign=top colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>BURnytt 26. June 2007 fra Telemark Barne- og Ungdomsråd</div></td></tr><tr align=left><td width=50% valign=top><a href=http://www.domain.no/download/070525-nrk.m3u style=text-decoration:none;color:3399bb;font-weight:bold;>Folkedans på NRK Telemark</a><br /><font size=1><i>29. May 2007</i></font><br />NRK Telemark sendte nylig et programinnslag om springdansen i Telemark. Med midler Eidsiva fylkeslag fikk fra Rådet for folkemusikk- og folkedans har de dokumentert springdansen til ...<br /><br /><a href=http://www.domain.no/index.php?id=179&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>God påske fra WWHF</a><br /><font size=1><i>02. April 2007</i></font><br />WWHF i Telemark vil med dette ønske alle våre brukere og samarbeidspartnere en riktig god påske. Vi har lagt bak oss en hektisk periode med blant annet årsmøte og ...<br /><br /><a href=http://www.domain.no/index.php?id=42&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Kampen om oppmerksomheten</a><br /><font size=1><i>22. March 2007</i></font><br />I en situasjon der media stadig beveger seg hurtigere, må de som ønsker å benytte seg av medienes innflytelse følge nøye med. Kampen om mediesekunder og –centimeter blir stadig tøf...<br /><br /><a href=http://www.domain.no/index.php?id=170&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />WWHF i Telemark avholdt årsmøte på fylkeshuset i Sarpsborg den 20. mars. Med 25 deltakere hvorav 22 stemmeberettigede ble dette et veldig godt årsmøte. Valgt møtel...<br /><br /><a href=http://www.domain.no/index.php?id=41&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />Telemark Barne- og Ungdomsråd inviterer alle våre medlems- organisasjoner til årsmøte tirsdag 20. mars 2007. Møtet avholdes på Fylkeshuset i Sarpsborg (Møterom 1). Påmedling innen 9...<br /><br /></td><td width=50% valign=top><a href=http://www.domain.no/index.php?id=40&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Samvittighetsgaver</a><br /><font size=1><i>20. March 2007</i></font><br />Det er tid for dårlig samvittighet. Dårlig samvittighet fordi du allerede før julaften har klart å stappe innpå altfor mange kilo ribbe og riskrem. Dårlig samvittighet fordi du vet...<br /><br /><a href=http://www.domain.no/index.php?id=38&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>UNG i Europa blir Aktiv ungdom</a><br /><font size=1><i>19. March 2007</i></font><br />EUs ungdomsprogram for ikke-formell læring er kjent under navnet UNG i Europa og videreføres fra 1. januar 2007 som programmet Aktiv ungdom. Barne-, ungdoms- og familiedirektoratet...<br /><br /><a href=http://www.domain.no/index.php?id=37&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Innsats mot mobbing</a><br /><font size=1><i>18. March 2007</i></font><br />Barne- og likestillingsdepartementet har nylig utgitt en håndbok for å stoppe mobbing i fritidsmiljøene. Boken skal sendes ut til fritidsklubber og frivillige barne-og ungdomsorgan...<br /><br /><a href=http://www.domain.no/index.php?id=36&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Inkludering i AUF</a><br /><font size=1><i>17. March 2007</i></font><br />AUF er en av seks pilot- organisasjoner som har deltatt i LNUs prosjekt Åpen og inkluderende. Les om hvordan de har arbeidet med prosjektet, få tips til inkludering, bli inspirert,...<br /><br /><a href=http://www.domain.no/index.php?id=35&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Fylkeskommunens budsjett 2007</a><br /><font size=1><i>16. March 2007</i></font><br />Den 7. november la fylkesrådmann Atle Haga frem administrasjonens forslag til årsbudsjett for 2007. For våre medlemsorganisasjoner og WWHFs del inneholdt forslaget ingen endringer ...<br /><br /></td></tr><tr align=left valign=top><td width=100% colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>© 2007 www.domain.no</div></td></tr></table><p style=font-family:arial;text-align:left;font-size:10px;>Skulle du ønske å stoppe dette abonnementet kan du gjøre det via WWHFs nettsider på:<br /><a href=http://www.domain.no/index.php?id=13&news=0 style=text-decoration:none;color:3399bb;>http://www.domain.no/index.php?id=13&news=0</a></p>"; $headers = "From: [email protected] \r\n"; $headers.= "Content-Type: text/html; "; $headers .= "MIME-Version: 1.0 "; mail("[email protected]", "Newsletter from me", $body, $headers); ?> I want to make this a cronjob, so I don't use a form. I run the script from commandline ($ php automail.php). The problem is that the body is cut in the recived email. It seems to stop after 1000 characters. Since I'm not running it with a browser (using it's cache-memory?) I belive there is some memorylimit for php, so I boosted php.ini. From phpinfo I now got: memory_limit 16M post_max_size 16M upload_max_filesize 8M This didn't change anything, and the recived email is still not complete - only 1000 characters or so are showing. The strange thing is that if I generate the html-code inside a textarea in a form, and then submitting the form I recive a complete email without errors.... How can I get this to work? __________________ @ngelot Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/ Share on other sites More sharing options...
Wuhtzu Posted June 27, 2007 Share Posted June 27, 2007 I have nothing to back this theory up, but I think it's due to the fact that you have the body in one long line... Even my editor wont allow your body line to be on one line, it breaks it at around 4096 chars or bytes... If you look at the manual for fgets() it mentions 4096 bytes when giving an example of reading a line to a specific length - maybe it's just a coincidence but it caught my eye Note: It is no problem for a string to become very large. There is no practical bound to the size of strings imposed by PHP, so there is no reason at all to worry about long strings. Maybe someone with the a greater theoretical computer/it background could comment on that? Back to your script: I tested it and it sent the email perfectly to both my gmail and my e-mail hosted by my webhost ([email protected]). The body is 5231 chars and that was exactly the number of chars which appeared in the source of the received e-mail. The only think I did to your script (or my editor did) was to split your body line over 2 lines... Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-283904 Share on other sites More sharing options...
@ngelot Posted June 27, 2007 Author Share Posted June 27, 2007 I tested it and it sent the email perfectly to both my gmail and my e-mail hosted by my webhost ([email protected]). The body is 5231 chars and that was exactly the number of chars which appeared in the source of the received e-mail. The only think I did to your script (or my editor did) was to split your body line over 2 lines... OK - that look promising! How do you split the body? Ex? $body_1 = "First part of the body....."; $body_2 = "Second part of the body...."; $body = "$body_1$body_2"; I suspect you did it in some other way? The syntax in my ex. must be wrong - because once again I get a too big $body-variable.... Can you post your code, please? Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-283955 Share on other sites More sharing options...
Wuhtzu Posted June 27, 2007 Share Posted June 27, 2007 Sorry about the "late" reply. I have just found out that my editor didn't split the line. It actually looks like below. Line 1, 2, 3 and then a . (dot) before line 4, meaning that line 3 is displayed as two lines... if you can follow. I didn't look at the line numbers before posting my last reply. I thought it added a line break but it didn't... So maybe you should forget about the "too long line theory" 1 <?php 2 3 $body = "<div style=margin:0px;padding:0px;background-image:url(http://www.domain.no/images/headerlogo.png);background-position:left;background-repeat:no-repeat;height:70px;color:ffffff;font-size:1px;>Dersom du ikke ser denne meldingen korrekt, vil du finne samme informasjon på http://www.domain.no.<br /><br /></div><table width=600 cellpadding=0 cellspacing=10 border=0 style=border-style:solid;border-width:1px;border-color:#000000;padding:0px;margin:0px;font-family:arial;text-align:left;font-size:14px;><tr align=left><td width=100% valign=top colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>BURnytt 26. June 2007 fra Telemark Barne- og Ungdomsråd</div></td></tr><tr align=left><td width=50% valign=top><a href=http://www.domain.no/download/070525-nrk.m3u style=text-decoration:none;color:3399bb;font-weight:bold;>Folkedans på NRK Telemark</a><br /><font size=1><i>29. May 2007</i></font><br />NRK Telemark sendte nylig et programinnslag om springdansen i Telemark. Med midler Eidsiva fylkeslag fikk fra Rådet for folkemusikk- og folkedans har de dokumentert springdansen til ...<br /><br /><a href=http://www.domain.no/index.php?id=179&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>God påske fra WWHF</a><br /><font size=1><i>02. April 2007</i></font><br />WWHF i Telemark vil med dette ønske alle våre brukere og samarbeidspartnere en riktig god påske. Vi har lagt bak oss en hektisk periode med blant annet årsmøte og ...<br /><br /><a href=http://www.domain.no/index.php?id=42&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Kampen om oppmerksomheten</a><br /><font size=1><i>22. March 2007</i></font><br />I en situasjon der media stadig beveger seg hurtigere, må de som ønsker å benytte seg av medienes innflytelse følge nøye med. Kampen om mediesekunder og –centimeter blir stadig tøf...<br /><br /><a href=http://www.domain.no/index.php?id=170&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />WWHF i Telemark avholdt årsmøte på fylkeshuset i Sarpsborg den 20. mars. Med 25 deltakere hvorav 22 stemmeberettigede ble dette et veldig godt årsmøte. Valgt møtel...<br /><br /><a href=http://www.domain.no/index.php?id=41&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />Telemark Barne- og Ungdomsråd inviterer alle våre medlems- organisasjoner til årsmøte tirsdag 20. mars 2007. Møtet avholdes på Fylkeshuset i Sarpsborg (Møterom 1). Påmedling innen 9...<br /><br /></td><td width=50% valign=top><a href=http://www.domain.no/index.php?id=40&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Samvittighetsgaver</a><br /><font size=1><i>20. March 2007</i></font><br />Det er tid for dårlig samvittighet. Dårlig samvittighet fordi du allerede før julaften har klart å stappe innpå altfor mange kilo ribbe og riskrem. Dårlig samvittighet fordi du vet...<br /><br /><a href=http://www.domain.no/index.php?id=38&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>UNG i Europa blir Aktiv ungdom</a><br /><font size=1><i>19. March 2007</i></font><br />EUs ungdomsprogram for ikke-formell læring er kjent under navnet UNG i Europa og videreføres fra 1. januar 2007 som programmet Aktiv ungdom. Barne-, ungdoms- og familiedirektoratet...<br /><br /><a href=http://www.domain.no/index.php?id=37&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Innsats mot mobbing</a><br /><font size=1><i>18. March 2007</i></font><br />Barne- og likestillingsdepartementet har nylig utgitt en håndbok for å stoppe mobbing i fritidsmiljøene. Boken skal sendes ut til fritidsklubber og frivillige barne-og ungdomsorgan...<br /><br /><a href=http://www.domain.no/index.php?id=36&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Inkludering i AUF</a><br /><font size=1><i>17. March 2007</i></font><br />AUF er en . av seks pilot- organisasjoner som har deltatt i LNUs prosjekt Åpen og inkluderende. Les om hvordan de har arbeidet med prosjektet, få tips til inkludering, bli inspirert,...<br /><br /><a href=http://www.domain.no/index.php?id=35&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Fylkeskommunens budsjett 2007</a><br /><font size=1><i>16. March 2007</i></font><br />Den 7. november la fylkesrådmann Atle Haga frem administrasjonens forslag til årsbudsjett for 2007. For våre medlemsorganisasjoner og WWHFs del inneholdt forslaget ingen endringer ...<br /><br /></td></tr><tr align=left valign=top><td width=100% colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>© 2007 www.domain.no</div></td></tr></table><p style=font-family:arial;text-align:left;font-size:10px;>Skulle du ønske å stoppe dette abonnementet kan du gjøre det via WWHFs nettsider på:<br /><a href=http://www.domain.no/index.php?id=13&news=0 style=text-decoration:none;color:3399bb;>http://www.domain.no/index.php?id=13&news=0</a></p>"; 4 5 $headers = "From: [email protected] \r\n"; 6 $headers.= "Content-Type: text/html; "; 7 $headers .= "MIME-Version: 1.0 "; 8 9 $sendmail = mail("[email protected]", "Newsletter from me", $body, $headers); 10 11 if($sendmail) { 12 echo "Mail sent successfully"; 13 } 14 else{ 15 echo "Mail _not_ sent.."; 16 } 17 18 ?> Here is the code without line numbering. As you can see I added an if-statement to check if the mail was actually sent successfully or not - just for the test purpose. <?php $body = "<div style=margin:0px;padding:0px;background-image:url(http://www.domain.no/images/headerlogo.png);background-position:left;background-repeat:no-repeat;height:70px;color:ffffff;font-size:1px;>Dersom du ikke ser denne meldingen korrekt, vil du finne samme informasjon på http://www.domain.no.<br /><br /></div><table width=600 cellpadding=0 cellspacing=10 border=0 style=border-style:solid;border-width:1px;border-color:#000000;padding:0px;margin:0px;font-family:arial;text-align:left;font-size:14px;><tr align=left><td width=100% valign=top colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>BURnytt 26. June 2007 fra Telemark Barne- og Ungdomsråd</div></td></tr><tr align=left><td width=50% valign=top><a href=http://www.domain.no/download/070525-nrk.m3u style=text-decoration:none;color:3399bb;font-weight:bold;>Folkedans på NRK Telemark</a><br /><font size=1><i>29. May 2007</i></font><br />NRK Telemark sendte nylig et programinnslag om springdansen i Telemark. Med midler Eidsiva fylkeslag fikk fra Rådet for folkemusikk- og folkedans har de dokumentert springdansen til ...<br /><br /><a href=http://www.domain.no/index.php?id=179&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>God påske fra WWHF</a><br /><font size=1><i>02. April 2007</i></font><br />WWHF i Telemark vil med dette ønske alle våre brukere og samarbeidspartnere en riktig god påske. Vi har lagt bak oss en hektisk periode med blant annet årsmøte og ...<br /><br /><a href=http://www.domain.no/index.php?id=42&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Kampen om oppmerksomheten</a><br /><font size=1><i>22. March 2007</i></font><br />I en situasjon der media stadig beveger seg hurtigere, må de som ønsker å benytte seg av medienes innflytelse følge nøye med. Kampen om mediesekunder og –centimeter blir stadig tøf...<br /><br /><a href=http://www.domain.no/index.php?id=170&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />WWHF i Telemark avholdt årsmøte på fylkeshuset i Sarpsborg den 20. mars. Med 25 deltakere hvorav 22 stemmeberettigede ble dette et veldig godt årsmøte. Valgt møtel...<br /><br /><a href=http://www.domain.no/index.php?id=41&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>WWHFs årsmøte 2007</a><br /><font size=1><i>21. March 2007</i></font><br />Telemark Barne- og Ungdomsråd inviterer alle våre medlems- organisasjoner til årsmøte tirsdag 20. mars 2007. Møtet avholdes på Fylkeshuset i Sarpsborg (Møterom 1). Påmedling innen 9...<br /><br /></td><td width=50% valign=top><a href=http://www.domain.no/index.php?id=40&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Samvittighetsgaver</a><br /><font size=1><i>20. March 2007</i></font><br />Det er tid for dårlig samvittighet. Dårlig samvittighet fordi du allerede før julaften har klart å stappe innpå altfor mange kilo ribbe og riskrem. Dårlig samvittighet fordi du vet...<br /><br /><a href=http://www.domain.no/index.php?id=38&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>UNG i Europa blir Aktiv ungdom</a><br /><font size=1><i>19. March 2007</i></font><br />EUs ungdomsprogram for ikke-formell læring er kjent under navnet UNG i Europa og videreføres fra 1. januar 2007 som programmet Aktiv ungdom. Barne-, ungdoms- og familiedirektoratet...<br /><br /><a href=http://www.domain.no/index.php?id=37&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Innsats mot mobbing</a><br /><font size=1><i>18. March 2007</i></font><br />Barne- og likestillingsdepartementet har nylig utgitt en håndbok for å stoppe mobbing i fritidsmiljøene. Boken skal sendes ut til fritidsklubber og frivillige barne-og ungdomsorgan...<br /><br /><a href=http://www.domain.no/index.php?id=36&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Inkludering i AUF</a><br /><font size=1><i>17. March 2007</i></font><br />AUF er en av seks pilot- organisasjoner som har deltatt i LNUs prosjekt Åpen og inkluderende. Les om hvordan de har arbeidet med prosjektet, få tips til inkludering, bli inspirert,...<br /><br /><a href=http://www.domain.no/index.php?id=35&news=0 style=text-decoration:none;color:3399bb;font-weight:bold;>Fylkeskommunens budsjett 2007</a><br /><font size=1><i>16. March 2007</i></font><br />Den 7. november la fylkesrådmann Atle Haga frem administrasjonens forslag til årsbudsjett for 2007. For våre medlemsorganisasjoner og WWHFs del inneholdt forslaget ingen endringer ...<br /><br /></td></tr><tr align=left valign=top><td width=100% colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>© 2007 www.domain.no</div></td></tr></table><p style=font-family:arial;text-align:left;font-size:10px;>Skulle du ønske å stoppe dette abonnementet kan du gjøre det via WWHFs nettsider på:<br /><a href=http://www.domain.no/index.php?id=13&news=0 style=text-decoration:none;color:3399bb;>http://www.domain.no/index.php?id=13&news=0</a></p>"; $headers = "From: [email protected] \r\n"; $headers.= "Content-Type: text/html; "; $headers .= "MIME-Version: 1.0 "; $sendmail = mail("[email protected]", "Newsletter from me", $body, $headers); if($sendmail) { echo "Mail sent successfully"; } else{ echo "Mail _not_ sent.."; } ?> So it's actually the exact same code as you posted... no changes what so ever But regarding the splitting of the body, which I still recommend doing because it will be easier to edit later, you can do something like this: $body = '<div style="some: color;">' . "\n" . "\t" . '<table cellspacing="5" border="1">' . "\n" . "\t\t" . '<tr>' . "\n" . "\t\t\t" . '<td>Some text</td>' . "\n" . "\t\t" . '</tr>' . "\n" . "\t" . '</table>' . "\n" . '</div>'; It's formatted with indents for you to see as you work on it in the editor and the "\t" will add indents to the actual source. "\n" adds new lines for your source. Thats how I would do it and does it when I create html e-mails in PHP... Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-284098 Share on other sites More sharing options...
@ngelot Posted June 27, 2007 Author Share Posted June 27, 2007 I tested it and it sent the email perfectly to both my gmail and my e-mail hosted by my webhost ([email protected]). The body is 5231 chars and that was exactly the number of chars which appeared in the source of the received e-mail. Since you got my script working and you recive the complete email would't that mean that my script is OK? Ergo the error is either my php or my mailserver configuration..... Let's start with php: 1. What version of php are you running? 2. Can you post me the output of: php -i | awk '/PHP Core/,/bcmath/' 3. Do you agree Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-284352 Share on other sites More sharing options...
@ngelot Posted June 27, 2007 Author Share Posted June 27, 2007 I think there is a limit issue. This is the source for the recived email: <div style=margin:0px;padding:0px;background-image:url(http://www.domain.no/images/headerlogo.png);background-position:left;background-repeat:no-repeat;height:70px;color:ffffff;font-size:1px;>Dersom du ikke ser denne meldingen korrekt, vil du finne samme informasjon på http://www.domain.no.<br /><br /></div><table width=600 cellpadding=0 cellspacing=10 border=0 style=border-style:solid;border-width:1px;border-color:#000000;padding:0px;margin:0px;font-family:arial;text-align:left;font-size:14px;><tr align=left><td width=100% valign=top colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>BURnytt 26. June 2007 fra Østfold Barne- og Ungdomsråd</div></td></tr><tr align=left><td width=50% valign=top><a href=http://www.domain.no/download/070525-nrk.m3u style=text-decoration:none;color:3399bb;font-weight:bold;>Folkedans på NRK Østfold</a><br /><font size=1><i>29. May 2007</i>< And this is the source if I add one extra letter in the html-code: <div style=margin:0px;padding:0px;background-image:url(http://www.domain.no/images/headerlogo.png);background-position:left;background-repeat:no-repeat;height:70px;color:ffffff;font-size:1px;>Dersom du ikke ser denne meldingen korrekt, vil du finne samme informasjon på http://www.domain.no.<br /><br /></div><table width=600 cellpadding=0 cellspacing=10 border=0 style=border-style:solid;border-width:1px;border-color:#000000;padding:0px;margin:0px;font-family:arial;text-align:left;font-size:14px;><tr align=left><td width=100% valign=top colspan=2><div style=margin-top:10px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding:5px;background-color:#000000;color:#ffffff;text-align:center;font-weight:bold;>KBURnytt 26. June 2007 fra Østfold Barne- og Ungdomsråd</div></td></tr><tr align=left><td width=50% valign=top><a href=http://www.domain.no/download/070525-nrk.m3u style=text-decoration:none;color:3399bb;font-weight:bold;>Folkedans på NRK Østfold</a><br /><font size=1><i>29. May 2007</i> Both files are 1004 bytes.... Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-284399 Share on other sites More sharing options...
Wuhtzu Posted June 28, 2007 Share Posted June 28, 2007 php -i | awk '/PHP Core/,/bcmath/' That looks like some linux command line stuff and I do not have access to the server. It's hosted by a hosting company.... but I run PHP 5.1.2 Regarding the limit issue I managed to send and receive all 5232 characters... actually I sent 5231 and received 5232 or the other way round... Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-284447 Share on other sites More sharing options...
@ngelot Posted June 28, 2007 Author Share Posted June 28, 2007 SOLVED !! I saved the html-code as a file (automail.txt) and then used fread in the mail-script: automail.php <? $filename = "/var/www/bla/automail.txt"; $handle = fopen($filename, "r"); $body = fread($handle, filesize($filename)); $headers = "From: [email protected] \r\n"; $headers.= "Content-Type: text/html; "; $headers .= "MIME-Version: 1.0 "; mail("[email protected]", "Newsletter", $body, $headers); ?> That did the trick - thanks for all help! Link to comment https://forums.phpfreaks.com/topic/57376-solved-a-big-html-body-using-php-mail-function/#findComment-284449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.