[PHP] Re: php +html mail
Hello, If you are new to php or other web technologies, you can find many information,examples about PHP and other web technologies in http://www.w3schools.com/ web sites. This is a great web site for web technology education. :) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net ""Wasantha De Silva"" <[EMAIL PROTECTED]>, haber iletisinde sunlari yazdi:[EMAIL PROTECTED] Dear all, I want get a help from you for some php codes. How can I get it. Regards wasantha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Mail script reading text from MySQL
On 6/2/06, Tom Chubb <[EMAIL PROTECTED]> wrote: What I meant is say a page outputs an HTML table eg: [snipped] But I want to get that code into the $message variable. I have written many mail scripts before it's just getting the data into the variable. Should I be using something like CURL? This other script cannot/should not be modified? Then you can either use shell_exec to execute the script and get the output $message = shell_exec('the/other/script.php'); or use file_get_contents(): $message = file_get_contents('http://domain/script.php?a=b'); or if the other script is also php look into output buffering. php.net/ob_start, php.net/ob_get_contents. Rabin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Mail script reading text from MySQL
I've just read a similar post and think that I should use file_get_contents and the preg_match for the & tags. ...But if anyone knows a better way I'm all ears! On 02/06/06, Tom Chubb <[EMAIL PROTECTED]> wrote: Sorry Mark, What I meant is say a page outputs an HTML table eg: a b c d e f g h i j k l m n o p q r s t u v w x y But I want to get that code into the $message variable. I have written many mail scripts before it's just getting the data into the variable. Should I be using something like CURL? On 02/06/06, Mark Cain <[EMAIL PROTECTED]> wrote: > > For my server configuration (Unix), mailing works like this for me. > > In the simplest manner mailing works in the following way: > > // build the email > $mail_to = [EMAIL PROTECTED]; > > $subject = "subject of mail goes here -- $variable_of_your_choosing"; > > $message = "The text of the message starts here > > $variable_of_your_choosing_2 > > $variable_of_your_choosing_3 > > "; > > $headers = "From: [EMAIL PROTECTED]" . > "Reply-To: [EMAIL PROTECTED]"; > > //send email > mail($mail_to, $subject, $message, $headers); > ?> > > > HTH, > > Mark Cain > > - Original Message - > From: "Tom Chubb" <[EMAIL PROTECTED]> > To: "[php] PHP General List" > Sent: Friday, June 02, 2006 10:59 AM > Subject: [PHP] HTML Mail script reading text from MySQL > > > >I can't work out how to load the text from a recordset result into a > > variable for sending using mail in a script. > > I have a script which creates a dynamic table then I want to load the > > table's HTML into a variable which will be echoed in the mail > function. > > I can't work out how to do this. > > I've tried calling the file using exec and fopen but I don't get any > > result. > > > > I have googled and RTFM (especially variable scope) but just can't > work > > out > > how to do it. > > Any help would be greatly appreciated. > > > > PS - I know there are many Mail classes out there, but I also realise > that > > this is something I will want to know how to do at a later time. > > Thanks, > > > > Tom > > > > -- Tom Chubb [EMAIL PROTECTED] 07915 053312 -- Tom Chubb [EMAIL PROTECTED] 07915 053312
Re: [PHP] HTML Mail script reading text from MySQL
Sorry Mark, What I meant is say a page outputs an HTML table eg: a b c d e f g h i j k l m n o p q r s t u v w x y But I want to get that code into the $message variable. I have written many mail scripts before it's just getting the data into the variable. Should I be using something like CURL? On 02/06/06, Mark Cain <[EMAIL PROTECTED]> wrote: For my server configuration (Unix), mailing works like this for me. In the simplest manner mailing works in the following way: HTH, Mark Cain - Original Message - From: "Tom Chubb" <[EMAIL PROTECTED]> To: "[php] PHP General List" Sent: Friday, June 02, 2006 10:59 AM Subject: [PHP] HTML Mail script reading text from MySQL >I can't work out how to load the text from a recordset result into a > variable for sending using mail in a script. > I have a script which creates a dynamic table then I want to load the > table's HTML into a variable which will be echoed in the mail function. > I can't work out how to do this. > I've tried calling the file using exec and fopen but I don't get any > result. > > I have googled and RTFM (especially variable scope) but just can't work > out > how to do it. > Any help would be greatly appreciated. > > PS - I know there are many Mail classes out there, but I also realise that > this is something I will want to know how to do at a later time. > Thanks, > > Tom > -- Tom Chubb [EMAIL PROTECTED] 07915 053312
RE: [PHP] HTML mail being sent with mail() not working for some people
On 27-Mar-2003 Jeff Lewis wrote: > We're sending out emails using mail() and sending it in HTML format and > while most people get it correctly a couple are not. They get the > anti-abuse > headers and then the HTML code appears as just that - HTML code in the > body > of the email. > > Sending those same people an HTML email composed in Outlook comes across > just fine, perhaps it's the anti abuse headers causing the issue? > > Has anyone heard or had experience with this? > google 'mime multipart alternative HTML' Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML mail being sent with mail() not working for some people
A bit more information on this...here is the code being used: $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* additional headers */ $headers .= "From: Jeff <[EMAIL PROTECTED]>\r\n"; $message = "test"; mail ('[EMAIL PROTECTED]', 'Quote of the Week from Jeff', $message, $headers); And again, it works for most people but two people have complained about this issue. At least one as using MS Outlook. Jeff - Original Message - From: "Jeff Lewis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 27, 2003 12:14 PM Subject: [PHP] HTML mail being sent with mail() not working for some people > We're sending out emails using mail() and sending it in HTML format and > while most people get it correctly a couple are not. They get the anti-abuse > headers and then the HTML code appears as just that - HTML code in the body > of the email. > > Sending those same people an HTML email composed in Outlook comes across > just fine, perhaps it's the anti abuse headers causing the issue? > > Has anyone heard or had experience with this? > > Jeff > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
Hi, I found this one and it's quite handy; http://phpmailer.sourceforge.net/ Regards, Frank - Original Message - From: "Ian A. Gray" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 2:47 PM Subject: [PHP] html mail > Hi, > I am quite new to php and I am trying to find a way of > sending details of a web form over e-mail in both text > and html format. There are numerous sites on the web > that try and explain how to do this but they are > worded very complicated and to be honest I haven't > found one that is particularly good. > > I want to send an e-mail that contains html code, with > the option of attatching images and other files as > well as a text version of the email so that the viewer > can read the same e-mail whether or not he can view > html email or not. > > Any ideas? > > Ian Gray. > > = > > - > Ian A. Gray > Manchester, UK > Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 > US Fax no.: 707-885-3582 > E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com (performance) & www.vocalstudio.co.uk (Tuition) > - > > > __ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
There is a technique to make a large comment at the top of your html based email, which would be your content readable by the users who have text-only. Granted all the html code would be at the bottom. I saw it done in a newsletter or two, very cleaver and effective! Dickon... - Original Message - From: "Ian A. Gray" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 9:46 AM Subject: [PHP] html mail > The pear class looks great, unfortunately my server > doesn't have pear yet. :-( > I didn't realise it was an either/or situation for > sending html or text only e-mails. I thought you > could send one e-mail which has the content in > text-only and html-format so that the person's e-mail > programme can decide how to read it. > > Ian Gray > > = > > - > Ian A. Gray > Manchester, UK > Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 > US Fax no.: 707-885-3582 > E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com (performance) & www.vocalstudio.co.uk (Tuition) > - > > > __ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
On Monday 10 March 2003 22:46, Ian A. Gray wrote: > The pear class looks great, unfortunately my server > doesn't have pear yet. :-( > I didn't realise it was an either/or situation for > sending html or text only e-mails. I thought you > could send one e-mail which has the content in > text-only and html-format so that the person's e-mail > programme can decide how to read it. Look in www.phpclasses.org, there's at least one class available which will do the job. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Unquestionably, there is progress. The average American now pays out twice as much in taxes as he formerly got in wages. -- H. L. Mencken */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
The PEAR Mail_mime class tends to take the headache out of this sort of thing. See the example at the bottom of the manual page: http://pear.php.net/manual/en/core.mail.mime.php mh. On Mon, 10 Mar 2003, [iso-8859-1] Ian A. Gray wrote: > Hi, > I am quite new to php and I am trying to find a way of > sending details of a web form over e-mail in both text > and html format. There are numerous sites on the web > that try and explain how to do this but they are > worded very complicated and to be honest I haven't > found one that is particularly good. > > I want to send an e-mail that contains html code, with > the option of attatching images and other files as > well as a text version of the email so that the viewer > can read the same e-mail whether or not he can view > html email or not. > > Any ideas? > > Ian Gray. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
On Wed, 24 Apr 2002, Wilbert Enserink wrote: > I'm studying some mail scripts written in php. When sending html mail > the scripts all use a method that involves sending an html file as > attachment. > > Why not use the mailsend function and send a string containing the whole > html code? Because that would be a violation of the protocols and would not work on a wide range of mail clients. Non-plain-text mail should be MIME-encapsulated. Why not just send raw PostScript? Digitized waveforms of the video signal from your CRT? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html mail
On Wednesday 24 April 2002 18:59, Wilbert Enserink wrote: > Hi all, > > > I'm studying some mail scripts written in php. When sending html mail the > scripts all use a method that involves sending an html file as attachment. > > Why not use the mailsend function and send a string containing the whole > html code? Because standard email wasn't designed for html mail. If you did what you suggest above then the recipient of your mail would just see your html code. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* We are experiencing system trouble -- do not adjust your terminal. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML mail
Hi Sid, Following link is an article about sending MIME email in php: http://www.phpbuilder.com/columns/kartic2807.php3 But I think it is too complicated for me to read:((. I suggest you can try following instead: $email_address="[EMAIL PROTECTED]"; $subject="anything you can do"; $email_contents="HTML test: write your HTML tags here"; $tips="Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit"; mail($email_address,$subject,$email_contnets,$tips); here $tips is the key for html mail. Hope this can help. Alex - Original Message - From: "Sid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 06, 2000 11:32 AM Subject: [PHP] HTML mail > hi, > How would you send HTML mail using the mail() function in PHP. > SID > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTML mail
> How would you send HTML mail using the mail() function in PHP. You need to use a MIME email - HTML goes as text/html, and graphics go as file attachments. Simple way to produce a MIME email: http://planetkiller.shadow.net.au/mime-php.txt Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML mail
Try this : "Haha hoho hehe ", 'html' => "Haha hoho hehe" ); $headers='From: [EMAIL PROTECTED] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_4195058==_.ALT" '; $message = ' --=_4195058==_.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed '.$EMAIL['plain'].' --=_4195058==_.ALT Content-Type: text/html; charset="us-ascii" '.$EMAIL['html'].' --=_4195058==_.ALT--'; mail("[EMAIL PROTECTED]", $subject, $message, $headers); ?> Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: "Rosen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 1:18 PM Subject: [PHP] HTML mail > Hi, > how can I send HTML mail via "mail()" function ? > I readed the tutorial, but can someone write me example ? > > Thanks, > Rosen > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML mail
you add this into your header bit: $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; HTH Jack - Original Message - From: Rosen <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 5:18 PM Subject: [PHP] HTML mail > Hi, > how can I send HTML mail via "mail()" function ? > I readed the tutorial, but can someone write me example ? > > Thanks, > Rosen > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]