Sending HTML email via PHP mail function

Reply

Join Date: May 2003
Posts: 1
Reputation: jessa_lee is an unknown quantity at this point 
Solved Threads: 0
jessa_lee jessa_lee is offline Offline
Newbie Poster

Sending HTML email via PHP mail function

 
0
  #1
May 13th, 2003
I've got a basic subscription list signup for a website, and a basic form to input the text for sending an email to the subscribers... but I need to know what steps I need to take to create an HTML email, place a different main topic in the newsletter each month, and still have it available to view from the site at a later time....

Can anyone help?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,035
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 125
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb
 
0
  #2
May 14th, 2003
I'm not sure exactly how extensive your knowledge is of PHP or how much you've done so far. Since you say this is written in PHP (or you want it to be) I take it you are working on a *Nix platform? Do you have sendmail configured on the server? A database set up to keep track of subscriptions as well as prior newsletters?
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Jul 2003
Posts: 1
Reputation: MIQuebec.NET is an unknown quantity at this point 
Solved Threads: 0
MIQuebec.NET MIQuebec.NET is offline Offline
Newbie Poster

Re: Sending HTML email via PHP mail function

 
0
  #3
Jul 21st, 2003
You must give content type see the example below:

mail($to, $object, $message, "From: $from\nReply-To: $from\nContent-Type: text/html;
8)
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Sending HTML email via PHP mail function

 
0
  #4
Jul 23rd, 2003
Originally Posted by MIQuebec.NET
You must give content type see the example below:

mail($to, $object, $message, "From: $from\nReply-To: $from\nContent-Type: text/html;
8)
Isn't there a " between the
  1. text/html;
and the ?
Reply With Quote Quick reply to this message  
Join Date: Oct 2003
Posts: 2
Reputation: OceanSurf is an unknown quantity at this point 
Solved Threads: 0
OceanSurf OceanSurf is offline Offline
Newbie Poster

Re: Sending HTML email via PHP mail function

 
0
  #5
Oct 20th, 2003
if you want to send HTML emails via PHP you should consider reading this article: http://www.phpbuilder.com/columns/kartic20000807.php3

I know it will help ;) cheers.-
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 47
Reputation: Banderson is an unknown quantity at this point 
Solved Threads: 4
Banderson's Avatar
Banderson Banderson is offline Offline
Light Poster

Re: Sending HTML email via PHP mail function

 
0
  #6
May 20th, 2006
This is how I send HTML email in my PHP Contact Form demo located at :
http://programmers-paradise.net/demo...ct/contact.php

The send email code is :
[php]@mail($to, $subject, $message, "From: $from\nContent-Type: text/html; charset=iso-8859-1");[/php]

You can download the Contact Form at:
http://programmers-paradise.net/pafi...tion=file&id=3

Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 116
Reputation: alpha2006 is an unknown quantity at this point 
Solved Threads: 5
alpha2006's Avatar
alpha2006 alpha2006 is offline Offline
Junior Poster

Re: Sending HTML email via PHP mail function

 
0
  #7
May 20th, 2006
Originally Posted by jessa_lee
I've got a basic subscription list signup for a website, and a basic form to input the text for sending an email to the subscribers... but I need to know what steps I need to take to create an HTML email, place a different main topic in the newsletter each month, and still have it available to view from the site at a later time....

Can anyone help?
I would suggest that you are use a PHP script already made to send your newsletter. Please also note that you have a very long email list, it is not a good idea to spend all the emails at the same time. You should include delays between sending x amount of emails.
This is because most hosting companies look out for accounts that sent a huge number of emails in a short period time. They identify such accounts as spammers and your account might get displayed.

You can find scripts that would handle that for you on hotscripts.com rather than spending a lot of time writting your own script and re-inventing the wheel.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 2
Reputation: jlillge is an unknown quantity at this point 
Solved Threads: 0
jlillge's Avatar
jlillge jlillge is offline Offline
Newbie Poster

Re: Sending HTML email via PHP mail function

 
0
  #8
Apr 5th, 2007
Originally Posted by cscgal View Post
I'm not sure exactly how extensive your knowledge is of PHP or how much you've done so far. Since you say this is written in PHP (or you want it to be) I take it you are working on a *Nix platform? Do you have sendmail configured on the server? A database set up to keep track of subscriptions as well as prior newsletters?
First, I am "jessa_lee" - though now married and I hadn't realized I had a username on DaniWeb when I created my new one My knowledge of PHP is limited, and the site is written with PHP. I already had the sendmail function set up on the site (4 years ago). What I wanted was for the client to be able to type up a newsletter and click submit, and for the PHP to do two things. 1) Send out the newsletter to all the subscribers (which it was already doing), and 2) store the fully typed newsletter in the MySQL DB for viewers to pull it up on the site. I also had the side of the site setup to view past newsletters... but the "create a newsletter archive" form was a seperate page from the "send a new newsletter" form and I didn't know what I needed to do to merge the two forms and have the script tell it to do both steps 1 and 2...

Does that make sense? I no longer run a web business, but I guess if there are others who would reference this posting for answers, I'd love any feedback (and to finally know for myself how to do it). Thank you for those of you who did post back when I requested - DaniWeb is AWESOME!
Last edited by jlillge; Apr 5th, 2007 at 2:19 pm. Reason: Noted username change :)
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1
Reputation: Cstrikedish is an unknown quantity at this point 
Solved Threads: 0
Cstrikedish's Avatar
Cstrikedish Cstrikedish is offline Offline
Newbie Poster

Re: Sending HTML email via PHP mail function

 
0
  #9
Apr 6th, 2007
There are all kinds of downloadable software in the web site.http://www.qweas.com/
With a strong search engine, you will find many software with discount or even free price.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC