Re: mail with html

From: Date: Mon, 23 Jul 2001 14:20:44 +0000
Subject: Re: mail with html
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59200@lists.php.net to get a copy of this message
You just need to have the proper MIME information deopending on what exactly you are trying to do. Also, the HTML must be in Quoted Printable Format. If you have PHP configured with imap you can just run your message through the imap_8bit function (or so I am told... I didn't have that luxury =P ). If not you just need to read the MIME specifications for quoted printable and follow all the rules. The rules for quoted printable can be found in section 5.1 of this document http://www.faqs.org/rfcs/rfc1521.html or section 6.7 of this document http://www.faqs.org/rfcs/rfc2045.html The other piece of advice I have to offer (having just finished a fairly large mail program myself) is to send yourself html messages in whatever mail reader you use and then telnet to your mail server and look at them there. That should at least give you an idea of what your message should look like. Sheridan ----- Original Message ----- From: Adrian D'Costa <adrian@pcsadvt.com> To: Sandeep Hundal <Sunny@mviva.net> Cc: php general list <php-general@lists.php.net> Sent: Monday, July 23, 2001 7:03 AM 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 (#59200) next »