FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Email attachment 0bytes using php4
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Email attachment 0bytes using php4 [message #182586 is a reply to message #182580] Fri, 16 August 2013 20:50 Go to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 16/08/13 20:09, Dave Drekter wrote:
> Ok, don't holler at me, I understand php4 is no longer. That said, for many reasons it's not possible to upgrade to php5 and use phpMailer - as much as I'd like to. I've searched around and there's no other answer presented. So, here's the problem. I create a text file /tmp2/tmporder2
>

TYhis worked for me. obviusly its not your finalsolution

function mail_html_file($email, $subject,$from,$return_path,$body)
{

$attach=
chunk_split(base64_encode(file_get_contents('../Images/Logo2.gif')));
$boundary = md5( time() );

$headers = sprintf("From: %s\nMIME-Version: 1.0\nContent-Type:
multipart/related; boundary=\"%s\"",
$from, $boundary);

$message = sprintf("--%s\nContent-Type: text/html;
charset=\"iso-9959-1\"\nContent-Transfer-Encoding:
quoted-printable\n\n%s\n\n--%s\nContent-Type: Image/gif;
name=\"Logo.gif\"\nContent-ID: <Logo2.gif>\nContent-Transfer-Encoding:
base64\n\n%s\n\n--%s--\n",
$boundary,$body,$boundary,$attach,$boundary);
mail($email, $subject, $message, $headers, "-f ".$return_path );
}
That worked on a linux apache exim mail based system..

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Limiting # characters in textarea
Next Topic: Function Problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 20:54:53 GMT 2024

Total time taken to generate the page: 0.03972 seconds