how to add attachment

From: Date: Sat, 02 Feb 2002 19:36:16 +0000
Subject: how to add attachment
Groups: php.general 
Request: Send a blank email to php-general+get-83251@lists.php.net to get a copy of this message
Hello > I was looking a way to fill a forms on line and send them over via the server. > > Found a good(in my mind) and simple php mail skript > from http://open.appideas.com/phpMailForm/source.php > > I managed to get it working. In my form there is a upload the the file section. > like this: > <FORM name="your_file" value="2000000"><input > name="attachment" type="file"> > with max value of 2megs. > It's not working. Pecause Im absolutely new in this I dont have a any idea how to > implement attachment part into this script.Original script is here: > > <? > $MailToAddress = "buysell@toolmecindustries.com"; > $MailSubject = "Equipment Posting"; > if (!$MailFromAddress) { > $MailFromAddress = "SENDERS@ADDRESS.GOES.HERE"; > } > $Header = ""; > $Footer = ""; > ?> > <html> > <body bgcolor="#FFFFFF"> > <font face="Arial"><center> > The following information has been delivered: > </center> > > <? > if (!is_array($HTTP_POST_VARS)) > return; > reset($HTTP_POST_VARS); > while(list($key, $val) = each($HTTP_POST_VARS)) { > $GLOBALS[$key] = $val; > $val=stripslashes($val); > echo "<b>$key</b> = $val<br>"; > $Message .= "$key = $val\n"; > } > > if ($Header) { > $Message = $Header."\n\n".$Message; > } > > if ($Footer) { > $Message .= "\n\n".$Footer; > } > > mail( "$MailToAddress", "$MailSubject", "$Message", "From: > $MailFromAddress"); > ?> > <br><br> > <b>Thank You!</b> > <br><br> > <a href="<? echo "$HTTP_REFERER"; ?>">Return To The Mail > Form</a><br><br> > <a href="/">Home Page</a><br><br> > > Can anybody help please.I dont know if I'm explained correctly so please excuse me. > Olev.

« previous php.general (#83251) next »