php - sending mail inserts a random space at the 995th character in the "to:" email list -



php - sending mail inserts a random space at the 995th character in the "to:" email list -

im using php's mail() function send e-mail multiple receivers.

if come in first parameter of "mail" function "example1@example.com,example2@example.com,example3@example.com,example4@example.com,example5@example.com,example6@example.com........" string of more 1000 characters, when receive e-mail see " "(an empty space) beingness inserted @ 995th character , whatever e-mail @ position broken.

i read because mail service server doesn't take long lines of string should insert "\n" @ every 70 or characters. therefore, tried using wordwrap($emaillist) should insert line-breaks.

unfortunately doesn't solve problem , i'm running out of ideas right now.

finally able solve problem this: have list in $strto variable contains emails "email1, email2, email3, email4, "... each email separated ", " .

before doing mail() function did this:

if($strto != ""){ $strto = wordwrap($strto,900,"\r\n "); $strto .= "\r\n"; }

which means set carriage return, new line , white space @ every 900 characters(without breaking words) , finally, @ end of string inserta carriage homecoming , line feed.

php string email character line-breaks

Comments

Popular posts from this blog

java - Bypassing "final local variable defined in an enclosing type" -

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -