Solved

Multiline header in mail function and in general ...

Posted on 2004-10-17
9
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

688 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