Reply to Re: send email to me

Your name:

Reply:


Posted by Steve on 10/24/07 20:24

"phpCodeHead" <phpcodehead@gmail.com> wrote in message
news:1193250040.807233.196970@q3g2000prf.googlegroups.com...
> On Oct 24, 8:23 am, "Steve" <no....@example.com> wrote:
>> "phpCodeHead" <phpcodeh...@gmail.com> wrote in message
>>
>> news:1193230925.440570.29590@v23g2000prn.googlegroups.com...
>>
>>
>>
>> > On Oct 24, 7:13 am, Dev <hanu...@gmail.com> wrote:
>> >> Dear All,
>> >> I have created a website.
>> >> in the contact us page i want to send all information (Entered by
>> >> visitor in text boxex) directly to my e-mail address.
>> >> to do this i have no idea because i am new to PHP.
>> >> thanks in advance
>> >> Dev
>>
>> > To get you started -> http://us.php.net/manual/en/ref.mail.php
>>
>> > For the Mail functions to be available, PHP must have access to the
>> > sendmail binary on your system during compile time. If you use another
>> > mail program, such as qmail or postfix, be sure to use the appropriate
>> > sendmail wrappers that come with them. PHP will first look for
>> > sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/
>> > usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have
>> > sendmail available from your PATH. Also, the user that compiled PHP
>> > must have permission to access the sendmail binary.
>>
>> 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?
>
> In regards to the op's post, yes it is!!! roflmao! Jeez! Lighten
> up...
>
> I was merely pointing the op to resources for *learning* how to solve
> his problem like most ppl use the newsgroups for.

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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация