Here is my exec command for sending email to users. I want to reformat the body of the mail by adding a newline after each App, config and counter type.
Here is the code that works but outputs everything in one line:
exec('echo "Please find attached the query result for: App: '.$varApp.' Config: '.$varConfig.' Counter Type: '.$varCtrType.' Thanks!" | /bin/mail -s "Testing" -a '.$output[8].' '.$varEmail.' 2>&1', $output2 );
Here is the output from that command in the user email body:
Please find attached the query result for: App: ABCDEF Config: GHIJK
Counter Type: LMNOP <br> Thanks!
I have tried using
and /r/n without any luck. I also tried different combinations of adding quotes and /.
The code that doesn't give any desired output.
exec('echo "Please find attached the query result for:'<br>' App: '.$varApp.' '<br>' Config: '.$varConfig.' <br> Counter Type: '.$varCtrType.' <br> Thanks!" | /bin/mail -s "Testing" -a '.$output[8].' '.$varEmail.' 2>&1', $output2 )
OR
exec('echo "Please find attached the query result for:/r/n App: '.$varApp.' /r/n Config: '.$varConfig.' <br> Counter Type: '.$varCtrType.' <br> Thanks!" | /bin/mail -s "Testing" -a '.$output[8].' '.$varEmail.' 2>&1', $output2 );
I think I don't know how to add breaks/newline in middle of this echo statement. Any guidance here is deeply appreciated!
Thanks!