well if that's just not about the dumbest thing i've ever heard!
here's is a short function all in php. it works with IIS or with any
command-line mail program. fuck compiling in crap like that!
<?
class email
{
static function send(
$to ,
$from ,
$cc = '' ,
$bcc = '' ,
$subject ,
$text = '' ,
$html = '' ,
$companyName = '' ,
$logo = null ,
$dropDirectory = '' ,
$exec = '' ,
$execOptions = ''
)
{
$messageHtml = $html;
$html = '
<html>
<style>
body
{
background-color : white;
color : black;
font-family : verdana, tahoma, arial, times new
roman, sans-serif;
font-size : 8pt;
margin : 0px;
text-align : left;
}
</style>
<body>
';
if (isset($logo))
{
$image = file_get_contents($logo);
$image = chunk_split(base64_encode($image));
$html .= '
<img alt="' . $companyName . '" border="0px"
src="cid:logo" style="float:right;">
<br>
<br>
<br>
<br clear="all">
';
}
if ($messageHtml == ''){ $messageHtml = '<html><body>' . $text; }
$html .= $messageHtml . '</body></html>';
if ($text == ''){ $text = $html; }
$boundry = '----=' . md5(uniqid(rand()));
$related = '----=' . md5(uniqid(rand()));
$mail = "MIME-Version: 1.0\r\n";
$mail .= "TO: " . $to . "\r\n";
$mail .= "FROM: " . $from . "\r\n";
$mail .= "CC: " . $cc . "\r\n";
$mail .= "BCC: " . $bcc . "\r\n";
$mail .= "Subject: " . $subject . "\r\n";
$mail .= "Content-Type: multipart/related;
boundary=\"$related\"\r\n\r\n\r\n";
$mail .= "--$related\r\n";
$mail .= "Content-Type: multipart/alternative;
boundary=\"$boundry\"\r\n\r\n\r\n";
$mail .= "--$boundry\r\n";
$mail .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$mail .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$mail .= $text . "\r\n\r\n";
$mail .= "--$boundry\r\n";
$mail .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$mail .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$mail .= $html . "\r\n\r\n";
$mail .= "--$boundry--\r\n\r\n";
$mail .= "--$related\r\n";
$mail .= "Content-Type: image/jpeg\r\n";
$mail .= "Content-ID: logo\r\n";
$mail .= "Content-Disposition: attachment;
filename=\"logo.jpg\"\r\n";
$mail .= "Content-Transfer-Encoding: base64\r\n\r\n";
$mail .= $image . "\r\n\r\n";
$mail .= "--$related--\r\n\r\n";
$mail .= "-- End --\r\n";
$fileName = $dropDirectory . strtoupper(md5(uniqid(rand()))) . '.eml';
file_put_contents($fileName, $mail);
if (!$exec){ return $mail; }
exec($exec . $fileName . $execOptions);
@unlink($fileName);
return $mail;
}
}
?>
not that hard now, is it?
Try looking in the manual, here:
http://uk2.php.net/manual/en/ref.mail.php
ahhh!
who is the *least* likely to RTFM? who is in the most need of RTFM?
wheat from chaff...wheat from chaff. if the op's of that genre can't answer
both of those questions correctly and then formulate a sound plan of action
from the 'discovery', the need to play with lego's or something...not php.
cheers.
> Take 10 deep breaths and learn this one thing before you die: Cook for
> a man, feed him for a day; teach a man to fish, feed him for a
> lifetime.
>
>
Teach a man to fish and he'll spend all his waking hours fishing!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
you did no such thing actually. you described a very obtuse process for
integrating a third-party email tool into php...such that php must be
compiled with it. first, that's not platform independant. second, it's
ludicrous! you think a noob php developer knows the first god damned thing
about compiling php...much less including third-party add-ons in the mix?!!
a suggesting to either RTFM or google would have sufficed much more nicely.
> I didn't realize one
> could just post problematic issues here, go home, beat the wife and
> kids, then come back to work the next day, check the newsgroups and
> viola! someone has written my problematic code for me. For free!
how you treat your wife and kids is up to you and of little concern to me.
and, if ever i saw a hole in php it would be in the venue of email. further,
if i've been using this solution for years - minus the compiling shit
suggestion, plus platform independence - is it really killing me to post
that code, as brief yet helpful as it is?
i get paid enough. i tell people to RTFM tons. i don't do that for certain
topics, email being one.
> Take 10 deep breaths and learn this one thing before you die: Cook for
> a man, feed him for a day; teach a man to fish, feed him for a
> lifetime.
two things...conventional wisdom is only convenient and acceptible because
it is more comforting than truthful. finally, i'll feed whomever i please. i
am at no point obligated to continue to do so. duh!
ain't that the truth! i started fishing again back in may and have been at
least twice a week since. i have found fishing for buffalo the closest i'll
get to the feeling of deep sea fishing...in a lake. the smallest i've caught
was 22lb. i catch at least one per trip. each takes about 15 minutes to
bring in. if i get 3 in one sitting, i leave. my arms hurt so much that i
just don't want to get another on.
;^)
cheers.
Ah, how I wish. I used to go lake fishing at least a couple of times a
week and to the beach at least once a month (I was in NC at the time).
Then I got married... Since then the only time since then I've been
fishing was for Marlins at Cabo San Lucas and one business trip out on
the Chesapeake Bay.
That was 11.5 years ago... :-(
it had been about 20 years for me. i had a friend who was having a rough
time and wanted to go fishing to clear his mind and think of happier things.
i'm glad he invited me! i grew up fishing but, after years of it, only
landed one 10 lb catfish, a 1 lb crappie, and a 3 lb large mouth
bass...crappy stats! i caught fish all the time of each kind...those were my
records though. i'm way into buffalo and carp. they are babies in the summer
and monsters by the fall...and man, they fight like their lives depended on
it. we fish off of a pier and use bungie chord to anchor the rods to the
metal benches...otherwise, your rod goes missing in the blink of an eye.
you ought to try it again. take your wife too.
Sounds like fun. I actually prefer blues myself. Some people don't
like them, but those don't know how to clean them. Properly cleaned
they're delicious. Not properly cleaned and they are quite oily.
I never have caught anything really big in lakes - largest was probably
about a 3-4 lb. northern or walleye up in Minnesota many years ago. I
haven't caught any big lake fish for a very long time. Have pulled some
big ones out of the surf, however. And around Chesapeake Bay we can get
some good sized rockfish.
And my favorite was a 130 lb marlin a few years ago. It's hanging on my
office wall :-)
As for the wife - she can take it for a while, but doesn't have the
patience to sit there all day waiting for a bite.
Sorry, Steve's got you here. He has a lot more wisdom than you do.
For instance, in your very first post -
"For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. "
Complete and utter nonsense. If that were the case, you couldn't
compile PHP on one system and run it on another with a potentially
different MTA. But that works fine. All PHP needs is the binary
available at runtime.
And while the Pear package your recommend is good, it does nothing to
help a new PHP programmer, and in fact requires that he learn MORE than
if he just used the mail() function.
Steve's post was much more informative. A new programmer will benefit
more from a good example than a "rtfm".
man, that had to be an awesome feeling! and what a great area you're in.
we're kind of limited in what we have around to catch. i hate going to the
gulf to shore fish...damn jellies and sting rays! deep sea is fun, but it's
kind of pricey unless you go for a few days - enter the wife and kids. ;^)
make sure you get out some time for a sanity break...then report back what
hall you brought in.
cheers.
> Sounds like fun. I actually prefer blues myself. Some people don't
> like them, but those don't know how to clean them. Properly cleaned
> they're delicious. Not properly cleaned and they are quite oily.
>
> I never have caught anything really big in lakes - largest was probably
> about a 3-4 lb. northern or walleye up in Minnesota many years ago. I
> haven't caught any big lake fish for a very long time. Have pulled some
> big ones out of the surf, however. And around Chesapeake Bay we can get
> some good sized rockfish.
>
I know its usually yourself that says this to other users - but what
does the above have to do with php ? .
Do as i say and not as i do ? .
well then, why bring it up...especially since you aren't even witty enough
to make it read as if *i* beat my kids or something. here's some
conventional wisdom for you..."from the abundance of the heart, the mouth
speaks." i guess that means you just *want* to beat your wife and kids.
> but, i'm not
> thrown off by the fact that it's the one thing in that paragraph that
> hit your mind enough to feel obligated to puke ignorance through you
> keyboard and onto this post.
hmmmm...you make a sweeping statement trying (emphasis) to be a sarcastic
smart-ass and lead it off with "beat my [your] wife and kids..."? how is the
fact that you ran on at the mouth for a paragraph and i noticed it, and
responded with ONE SENTENCE - how is that equal to *over-noticing*?
you're funny.
> i will teach whomever i please. i am at no point obligated just the
> same! double duh!
>
> you have no concept of wisdom, conventional or otherwise; i've
> researched your posts across the internet, most simply stem
> controversy and put other ppl down
again, funny! yeah, at least i directly address the statements you make with
counters that apply. using ad-homonyms means you lose. remember, you said
"feed, man, one day; teach, fish, fed, forever"? my counter was "feed/teach
whomever; doesn't mean i have to do either". keep on task, will you!
> ... and this is ok for the likes of
> you and ppl like you;
i love your voice. it would kinda fit in with other phrases of the early 20
century...like, "why i outta"...i'm thinking curly, or maybe even moe. rof!
> but, as far as about 98% of the rest of the
> population goes we're just not on board with you.
really? that's because (on average) each person only meets around 2K people
in a lifetime. and, given that there are 4B+ people, it's not hard to
imagine that just about any deck on which any one of us stand that we will
do so alone, in the site of those statistics. however, you have no idea
where the 2K people i know stand. for all you know, 100% of them may also
agree that you suggestion is D.U.M.B. now those are numbers worth talking
about.
as it is, you are throwing a big juicy red-herring out there. don't try to
divert the subject to 'other' posts. deal with the one at hand. otherwise,
you just look silly. then again, i see you are wont to such behavior given
your initial 'solution' to the op.
> over and out on this convo -- gone fishing!
convo? over-and-out? wtf?
ok, burt.
btw, 'gone fishing' is most likely what people read when casting a glance
your way. (see, now that's ad-homonym...but AFTER i directly counter your
arguments)
well krusty, jerry only gets OT once in a while. still well under the order
of magnituted of your loss of focus.
carry on.
Yea, it was great. Didn't get it up here, though - we were vacationing
in Cabo San Lucas :-). And right after that, my wife pulled in a 125
lb. marlin. And she did it all by herself.
And yes, deep sea is pricey, so I don't do it much, either. But both
pier and surf fishing was generally pretty good along the Outer Banks of NC.
The Chesapeake has a lot of little jellyfish up around Baltimore, but by
the time you get down to Annapolis and below there aren't many there at
all. But there also aren't any fishing piers.
consider the venue. i spent more time thinking of what to say rather than
the spelling. while 'haul' is what i know to be the word, i spelled 'hall'.
big deal. if you want to pick at that kind of stuff all day, go ahead. i do
it all the time. and i don't spell check either. hell, i've been thinking
outloud so fast sometimes that i've left out two to three words at a time in
one sentence.
now that aside, red-herring/ad-homonym boi, care to actually stick to the
subject and try and defend your point? since the answer is obviously 'no', i
have as little use for you as the op did for your rubbish reply.
i must have worked you up something fierce! this is like watching the ants
after a foot-plant in their mound. weee, look at you scurry! you're
basically saying by your actions that i own you...or can control more of you
emotions that is wise.
hmmm...not only is your reading comprehension shot, your logic is as well.
while, as i stated, 4B+ people in the world does have their way of thinking,
most likely is the case that few will agree with any one persons thoughts.
further, it is ludicrous to suggest that they all side with you! in fact, i
think i saw jerry pound your little tantrum too. seems he sided more with me
than you...and for what? the same reasons. LOL. now, you'd do well to get
someone to agree with you...lest you be suggesting that your comment above
is merely your own projection.
Steve, ignore him. It's just the troll back again under a new 'nym.
i wouldn't doubt it.
while i address every red-herring you throw out there, i certainly don't
allow you to tangent off from the subject...which is, your 'solution' to the
op's problem S.U.C.K.S.
as for me addressing *that*, i continually have. you continually try to veer
off topic...presumably b/c you know your 'solution' to the op's problem
S.U.C.K.S.
> who owns who? lol! this is just spare time fun for me now... but, i
> doubt i'll bother trying to make sense of any more of your percentage
> of peeps conventional wisdom. lol.
<whisper>
you do know that 'conventional wisdow' is in the form of a cliche that is
passed about capriciously, right? what i did was use *logic* to show that
stats would lend your posit more wrong than right. we'll keep that lil brain
fart of yours, our lil secret.
</whisper>
> and by the way, take note that the op, Dev, was out on the convo from
> the get go!
'convo' - sation?
yeeew tawk'n lock a cuntree fella, ur summp'n?
> now, it's just you, me, Jerry, and Krusty talking about fishing!
no, jerry and i were talking fishing. krustoff was saying the thread is OT.
and gawd knows what the fuck you're talking about!