What's wrong with this header?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flycast
Forum Commoner
Posts: 37
Joined: Wed Jun 01, 2005 7:33 pm

What's wrong with this header?

Post by flycast »

mail() is rejecting this header:
From: someplace Reply-To: no-reply@domainremoved.com Return-Path: my.name@domainremoved.net MIME-Version: 1.0 X-Mailer-ListID: 5 Content-Type: multipart/alternative; boundary="==MULTIPART_BOUNDARY_1ca5af0af30108b1d84116c29bb18d28"
Any ideas?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do you add any new lines when you create the headers?

Mac
flycast
Forum Commoner
Posts: 37
Joined: Wed Jun 01, 2005 7:33 pm

Post by flycast »

Are newlines bad? Should there be one at the end?
saumya
Forum Contributor
Posts: 193
Joined: Sun Jan 30, 2005 10:21 pm

Post by saumya »

new lines are not bad.But any extra character will break your code. "any" means "any", it may be a space too.
flycast
Forum Commoner
Posts: 37
Joined: Wed Jun 01, 2005 7:33 pm

Post by flycast »

What is the proper format for a header? Where is there a readable document on this?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

flycast
Forum Commoner
Posts: 37
Joined: Wed Jun 01, 2005 7:33 pm

Post by flycast »

Thanks timvm but we're talking emails here. This link is HTML. Are they the same?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

AFAIK, you need new lines in your headers so that each one is on a new line. The headers posted all ran into each other so I wondered if that was the problem :)

Mac
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

search for phpmailer, it is highly recommended for use of sending mails in php as it is not blocked by spam filters and such
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Sorry, here is the correct one :)

ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt.
Post Reply