RE: [PHP] mail with html

From: Date: Mon, 23 Jul 2001 12:08:15 +0000
Subject: RE: [PHP] mail with html
Groups: php.general 
Request: Send a blank email to php-general+get-59183@lists.php.net to get a copy of this message
you don't. as far as I know, you just put the code in the message like such : $message = " <table> <tr> <td>$name</td><td>areacode</td> </tr> </table> "; and then send off $message using mail(). You might want to stripslashes() as I did. /sunny -----Original Message----- From: Adrian D'Costa [mailto:adrian@pcsadvt.com] Sent: 23 July 2001 13:04 To: Sandeep Hundal Cc: php general list Subject: RE: [PHP] mail with html The question is how do I declare the html coding in the message part. Any samples Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: > well all you need to do is use part of the script i sent you.. and in the > header variable, uncomment the bit which says "text/html" and then you can > send html email instead of text email... > > i'm assuming you've already written the script to sent plain text email. i > thought you needed that. > > /sunny > > -----Original Message----- > From: Adrian D'Costa [mailto:adrian@pcsadvt.com] > Sent: 23 July 2001 12:26 > To: Sandeep Hundal > Cc: php general list > Subject: RE: [PHP] mail with html > > > Hi Sandeep, > > Thanks for your mail but I was looking at something else. This is what I > need. > > I have a table that I will be selecting certian records and mailing to > clients that have signed up. The result should be in html and plain > text. The plain text is working now but I want to put into a table format > to look neater, below is a sample in text format. Any clues? > > Destinazione Periodo Vitofferte > London 2001-07-31 Chf 385 > Hammamet 2001-07-28 Chf 999 > > Adrian > > > On Mon, 23 Jul 2001, Sandeep Hundal wrote: > > > oh yeah, you might want to tidy up the code a bit... the email has put in > > line breaks. > > > > and replace nothing@nothing.com with your own email... > > the mail() command does all the work... > > the header command redirects the page.. you might want to change the > address > > or remove it. > > > > /sunny > > > > -----Original Message----- > > From: Sandeep Hundal [mailto:Sunny@mviva.net] > > Sent: 23 July 2001 11:06 > > To: 'Adrian D'Costa'; php general list > > Subject: RE: [PHP] mail with html > > > > > > here's a script i wrote a while back..... copied and pasted. > > > > > > --------------------- > > <? > > if ($submit) { > > $headers .= "From: $myemail \n"; > > $headers .= "cc:$cc \n"; > > $headers .= "bcc:$bcc \n"; > > // $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; > > > > $message = stripslashes($contents); > > header("Location:http://www.wde.org/me/"); > > mail($to, $subject, $message, $headers); > > } > > > > else { > > echo "<html>"; > > $myemail1 = "nothing <nothing@nothing.com>"; > > > > echo " <br><form action=\"$php_self\" > > method=\"post\"> > > <table cellpadding=15 cellspacing=0 width=100% > > bgcolor=#ffffff> > > <tr> > > <td align=right><strong > > class=black>from which account :</strong></td> > > <td><select name=\"myemail\"> > > <option > > value=\"$myemail1\">nothing@nothing.com > > </select> > > </td> > > > > </tr> > > > > <tr> > > <td align=right><strong > > class=black>email to :</strong></td> > > <td><input type=text > > name=\"to\"></td> > > </tr> > > <tr> > > <td align=right><strong > > class=black>copy to :</strong></td> > > <td><input type=text > > name=\"cc\"></td> > > </tr> > > <tr> > > <td align=right><strong > > class=black>blind copy to :</strong></td> > > <td><input type=text > > name=\"bcc\"></td> > > </tr> > > <tr> > > <td align=right><strong > > class=black>subject :</strong></td> > > <td><input type=text > > name=\"subject\"></td> > > </tr> > > <tr> > > <td valign=top align=right><strong > > class=black>email message :</strong></td> > > <td><textarea cols=45 rows=15 > > name=\"contents\" wrap=physical></textarea></td> > > </tr> > > <tr> > > <td>&nbsp;</td> > > <td><strong class=black><input > > type=submit name=submit value=\"send this email\"></strong></td> > > </tr> > > </table> > > </form>"; > > } > > ?> > > --------------------- > > > > that should work as a page in itself.... let me know if you have > > problems.... > > > > /sunny > > > > > > -----Original Message----- > > From: Adrian D'Costa [mailto:adrian@pcsadvt.com] > > Sent: 23 July 2001 11:09 > > To: php general list > > Subject: [PHP] mail with html > > > > > > Hi, > > > > I know this subject had been discussed here before. Tried searching in > > list.php.net, I get a message search not setup (or something). > > > > I want to send html mails thru php using mail(). Could someone tell me > > where I can study some scripts or tutorials. > > > > TIA > > > > Adrian > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#59183) next »