CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Formatting an email

Print topic Send  topic

Author Message
Frank S.
Posted: 03/12/2002, 1:38 PM

Hi all,
Can anyone tell me how to format an email so that I have line breaks in PHP?
Thanks,
Frank

Chris Seymour
Posted: 03/12/2002, 2:52 PM

Hi Frank,
Depending on the type of email you are sending you need to include:

For html email you would include either a <p> or <br>

For text email you would include a \n at the end of the line.

Let me know if you need further assistance.

Cheers.

Chris
fsurget@auuooh.com (Frank S.) wrote in
<a6lsgh$s1c$1@news.codecharge.com>:

>Hi all,
>Can anyone tell me how to format an email so that I have line breaks in
>PHP? Thanks,
>Frank
>
>
>
Frank S.
Posted: 03/12/2002, 3:04 PM

Hi Chris,
I'm trying to format the results from the Tell A Friend example. Here's a
sample of the code from the "Before Insert":

$body = "Hello " . get_param("to_name") . "!" . chr(13) .
chr(13) . get_param("from_name") .
" sent you this page from the Sample Company Web Site." . chr(13) .
"http://samplecompany.com" . chr(13) . chr(13) . "Comments from " .
get_param("from_name") . ":" . chr(13) . get_param("message_comments") . ":"
.. chr(13) . get_param("from_email");

I've tried to place the \n within different areas but keep getting errors.
Any idea where I would place the linebreaks?
Thanks,
Frank


Glenn Holden
Posted: 03/12/2002, 3:12 PM

The \n should be quoted or part of your other quoted text.
In the example below I'd say replace the chr(13) with "\n"

Glenn


"Frank S." <fsurget@auuooh.com> wrote in message
news:a6m1ii$5pt$1@news.codecharge.com...
> Hi Chris,
> I'm trying to format the results from the Tell A Friend example. Here's a
> sample of the code from the "Before Insert":
>
> $body = "Hello " . get_param("to_name") . "!" . chr(13) .
> chr(13) . get_param("from_name") .
> " sent you this page from the Sample Company Web Site." . chr(13) .
> "http://samplecompany.com" . chr(13) . chr(13) . "Comments from " .
> get_param("from_name") . ":" . chr(13) . get_param("message_comments") .
":"
> . chr(13) . get_param("from_email");
>
> I've tried to place the \n within different areas but keep getting errors.
> Any idea where I would place the linebreaks?
> Thanks,
> Frank
>
>
>

Frank S.
Posted: 03/12/2002, 3:12 PM

Thanks, Glenn
I'll give it a try.
Frank


Frank S.
Posted: 03/12/2002, 3:23 PM

Nope, got the below error when I replaced the "chr(13)" with "\n".
Any other suggestions?

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in

Chris Seymour
Posted: 03/12/2002, 3:32 PM

Hi Frank try something like this:

$body = "Hello " . get_param("to_name") . "!\n\n" . get_param("from_name")

Let me know how that works.

Chris
Glenn Holden
Posted: 03/12/2002, 3:35 PM

Be sure you are replacing

.. chr(13) .

with

.. "\n" .

The quotes are required.


"Frank S." <fsurget@auuooh.com> wrote in message
news:a6m2lk$7p2$1@news.codecharge.com...
> Nope, got the below error when I replaced the "chr(13)" with "\n".
> Any other suggestions?
>
> Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.