CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 mailto body ignoring new lines

Print topic Send  topic

Author Message
okdoke

Posts: 3
Posted: 09/13/2008, 6:14 PM

I've got a mailto link that works, except for the message body. No matter what I try, it will not display the data in the message on separate lines. This is an example of what I want for the body:

Order id: 12345
From quote: 9999

However, no matter what I do, it shows in the email as:
Order id: 12345 From quote: 9999

I've tried:

$msgblock = "Order ID: ".$wordspec->wordndx->GetValue(); $msgblock .= "\r\n"; $msgblock .= "From quote:  ".$wordspec->wquotenum->GetValue();

It's ignoring the new line. I also tried constructing the msgblock using <br> to see if that would help and it doesn't. It still gives me no new line and the <br> shows in the message body.

Any suggestions?
View profile  Send private message
datadoit
Posted: 09/13/2008, 8:56 PM

Try using chr(10) and chr(13) instead of \r\n.
okdoke

Posts: 3
Posted: 09/14/2008, 6:24 AM

Good idea, but it didn't work. While trying to figure it out, I tried sending the email automatically using mail() and I can get the correct format if I use <br>. So maybe it's something with the email client itself? Any other time I've used mailto, I've only had to send the addressee and the subject.

Thanks for trying to help. I was not sending the email automatically for a reason, but I can live with it and use mail() instead.

View profile  Send private message
datadoit
Posted: 09/14/2008, 8:28 AM

Also try urlencode().
datadoit
Posted: 09/14/2008, 8:32 AM

I would recommend using PHPMailer class
(http://phpmailer.codeworxtech.com/). You may not need the features
today, but eventually you will. Start using it now and you won't have
to go back later to rewrite your code.

Add new topic Subscribe to topic   


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.