Page 1 of 1

can only pass one paramater to mail headers

Posted: Sun Jan 24, 2010 2:38 pm
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:

Re: can only pass one paramater to mail headers

Posted: Sun Jan 24, 2010 6:37 pm
by jazz090
bump

Re: can only pass one paramater to mail headers

Posted: Sun Jan 24, 2010 7:39 pm
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