Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Multiline header in mail function and in general ...

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
akashwiz
Asked:
akashwiz
  • 5
  • 4
1 Solution
 
ZylochCommented:
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
 
akashwizAuthor Commented:
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
 
ZylochCommented:
I don't know if this is possible. I guess you can also try

firstline\r\n:secondline\r\n
0
Technology Partners: 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!

 
akashwizAuthor Commented:
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
 
ZylochCommented:
You mean multiline headers?
0
 
akashwizAuthor Commented:
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
 
ZylochCommented:
Try this:

firstline\n secondline\r\n
0
 
akashwizAuthor Commented:
Got it..  Thanks.. let me experiment a bit then I will accept your answer.
0
 
ZylochCommented:
Seems that the space is needed ;)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now