Solved

Multiline header in mail function and in general ...

Posted on 2004-10-17
9
283 Views
Last Modified: 2008-02-01
How do I send a multiine header in a email sent through PHP's mail function. Something line this:

X-MY-HEADER:  **********************
                                HELLO WOLRLD !
                       **********************

I tried using:

mail("me@mymail.com", "test", "test", "X-MY-HEADER: firstline \r\n secondline")

mail("me@mymail.com", "test", "test", "X-MY-HEADER: firstline \n secondline\r\n")

But they sent the second line in body of message. Please help.
0
Comment
Question by:akashwiz
  • 5
  • 4
9 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12335642
Hi akashwiz,

What about

firstline\r\nsecondline\r\n?

Or does it need to have something like this?

firstline\r\nComment: secondline\r\n?

Regards,
Zyloch
0
 
LVL 1

Author Comment

by:akashwiz
ID: 12335668
firstline\r\nsecondline\r\n   sent the second line in the body and firstline\r\nComment: secondline\r\n added another header "comment". I want both lines to be a part of same header.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12335675
I don't know if this is possible. I guess you can also try

firstline\r\n:secondline\r\n
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 1

Author Comment

by:akashwiz
ID: 12335707
This is possible as I am receiving mails with same type of headers but unable to reproduce the same. Or is there a way by which I can insert hidden text into a e-mail?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12335726
You mean multiline headers?
0
 
LVL 1

Author Comment

by:akashwiz
ID: 12335742
I want to insert some multiline text in the mails I send which remains invisible to the receiver. One way is to use a multiline header. But I don't know how to do it. Yes I am receiving mails with multiline headers.
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 100 total points
ID: 12335776
Try this:

firstline\n secondline\r\n
0
 
LVL 1

Author Comment

by:akashwiz
ID: 12335799
Got it..  Thanks.. let me experiment a bit then I will accept your answer.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12335813
Seems that the space is needed ;)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question