can only pass one paramater to mail headers

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
User avatar
jazz090
Forum Contributor
Posts: 176
Joined: Sun Apr 12, 2009 3:29 pm
Location: England

can only pass one paramater to mail headers

Post by jazz090 »

My PHP file attachments kept coming back as base64, then I found out that only 1 header was getting passed into it instead of the two I had defined (from header followed by content-type).

first I had this:

Code: Select all

$header = "From: XYZ <xyz@wxyz.com>\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$boundry."\"";
then i switched lines one and two. this time all the attachments appeared properly but From header was missing. I changed the two parameters to From and X-Mailer, same problem, only the first one is getting passed into it. what's going on? :banghead: :banghead: :banghead: :banghead:
User avatar
jazz090
Forum Contributor
Posts: 176
Joined: Sun Apr 12, 2009 3:29 pm
Location: England

Re: can only pass one paramater to mail headers

Post by jazz090 »

bump
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: can only pass one paramater to mail headers

Post by alex.barylski »

Use a class such as SwiftMailer to simplify the management and handling of emails...to many caveats to write the code manually. Adding attachments is a simple matter of using a trivial API.

Cheers,
Alex
Post Reply