Solved

Multiline header in mail function and in general ...

Posted on 2004-10-17
9
284 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

820 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