Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Website Design/Showcase (http://www.chiefdelphi.com/forums/forumdisplay.php?f=64)
-   -   return line commands in PHP (http://www.chiefdelphi.com/forums/showthread.php?t=32930)

robot180 17-01-2005 11:54

return line commands in PHP
 
I could use some help. I am using the mail() function to send an email in a "helpdesk" like program. I have the person's name and email address attach to the message, however I want to put a few blank lines in between. I used the \n, \r, and \t commands in between them, but they don't do anything.

Another thing I need help with is that the mail function allows you to put other headers in. Do I need to enter anything in those?

Greg Marra 17-01-2005 12:26

Re: return line commands in PHP
 
If it was an HTML e-mail you could just toss in a couple <br>'s...

evulish 17-01-2005 19:05

Re: return line commands in PHP
 
No, it's not necessary to add any other headers to mail(). There are some you may want, such as the From, Reply-To, Content-Type, MIME-Version, To, CC, BCC. It should work just fine with none, though. Using \n in the body should also work unless you've specified a different Content-Type (like HTML, which doesn't care about new-lines). If you're checking it on a Windows client, you may need to use \r\n, but I'm not positive.

Jack 17-01-2005 19:37

Re: return line commands in PHP
 
99% sure on this.. if you use single quotes 'text\ntest'.. the new line doesn't happen. you need to use double quotes "text\ntest" instead.

jack

AIBob 18-01-2005 21:31

Re: return line commands in PHP
 
Quote:

Originally Posted by robot180
Another thing I need help with is that the mail function allows you to put other headers in. Do I need to enter anything in those?

You do not need to put any other headers in it for many webhosts... It really depends on what the webhost has it set as..
Usually webhosts require you to put the From: header.... but that is not always the case.

steven114 19-01-2005 00:47

Re: return line commands in PHP
 
I believe the standard requires \r\n between header lines. At least that's what I use for my PHP mails and it works great...

HFWang 19-01-2005 02:22

Re: return line commands in PHP
 
Quote:

Originally Posted by robot180
I could use some help...

We've all guessed... but did it work?

I feel like I'm reading a mystery novel but can't find the last chapter.

steven114 19-01-2005 10:26

Re: return line commands in PHP
 
http://cr.yp.to/docs/smtplf.html

robot180 20-01-2005 14:59

Re: return line commands in PHP
 
Quote:

Originally Posted by Jack
99% sure on this.. if you use single quotes 'text\ntest'.. the new line doesn't happen. you need to use double quotes "text\ntest" instead.

jack

I put it in single quotes. Sorry it took so long to answer. I always use single quotes unless I use nested quotes. Thanks.


All times are GMT -5. The time now is 02:54.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi