473,813 Members | 3,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending PHP forms via HTML email

How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulati ons $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.
Jul 17 '05 #1
4 7749
sk
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@ho tmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulati ons $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


Jul 17 '05 #2
Unfortunately it requires installing Pear, more than I bargained for.
Any other alternative?

sk <st***********@ hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579 409$Oz4.558595@ rwcrnsc54>...
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@ho tmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulati ons $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.

Jul 17 '05 #3
sk
ph**********@ho tmail.com wrote:
Unfortunately it requires installing Pear, more than I bargained for.
Any other alternative?
1. Find an HTML email somewhere in your inbox.

2. View source.

3. Look at how the message is formed.

4. Form a message that resembles it structurally. For the bulk of the
body, "heredoc" syntax is your friend. What you want to do is build the
body as one long string, with the variables you want inserted in the
appropriate places, just like you would if you were making a web page.
Then pay attention to the headers that define it as a MIME message with
HTML contents, as well as any MIME separators in the message itself.
You'll need to add those headers using the API of whatever mail call you
use, and add the in-message separators manually to the body of the message.

5. Send the mesaage.

6. Make sure it arrives and displays properly in a couple of
representative mail programs. Some mail programs are more forgiving of
little MIME mistakes than others.

6. After you do this a few times with convoluted, cranky code to get the
headers and separators working just right, see if you can use PEAR's
Mail_mime in the future. It's installed by default with newer releases
of PHP, and isn't too difficult to install otherwise as long as you have
control over php.ini. If your web host can't or won't support PEAR, ask
yourself why.

sk <st***********@ hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579 409$Oz4.558595@ rwcrnsc54>...
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@ hotmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratul ations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


Jul 17 '05 #4
Hello,

On 10/18/2003 01:12 AM, ph**********@ho tmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulati ons $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


You may want to try this class that lets you compose and send HTML
messages properly:

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2977
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
11
2869
by: ColinWard | last post by:
Hi. I have the following code in a module which sends email via Outlook. Option Compare Database Option Explicit ' Declare module level variables Dim mOutlookApp As Outlook.Application Dim mNameSpace As Outlook.NameSpace Dim mFolder As mapiFolder Dim mItem As MailItem
3
2230
by: VB Programmer | last post by:
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails. 1. What do I need on the server so that it has the abillity to send out emails? It is a Windows 2000 Professional SP3 server. 2. Any examples (code, etc...) on how to send out emails via an ASP.NET webform? Thanks!
2
1509
by: Rene | last post by:
Hi all i need some help. i try to send mail with the following code. Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Dim mailMsg As New MailMessage mailMsg.From = rene.fehr@netradox.com mailMsg.To = info@netradox.com mailMsg.Subject = "Testmail vom Webforum" mailMsg.Body = "some body text"
6
2755
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
4
5057
by: Roger Withnell | last post by:
I'm sending Russian text in an email generated from the website which displays in the email as ?????????? The website is set to codepage 65001 and the charset to utf-8. Please advise. Posted Via Usenet.com Premium Usenet Newsgroup Services
7
4396
by: Ray Booysen | last post by:
Hi all I'm sending email via ASP.NET in HTML mode. Each email has exactly one attachment and I do have full access to the SMTP server. However, if I send the email in HTML format, the framework reports the following exception: "System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown
1
1424
by: HenHouse | last post by:
Hi folks; I have a pretty simple problem which is proving tricky to solve... I have a form that displays various contact information about an individual, and one of these items of information is an email address. Below this I've added a button labelled "Email Me!" You'll never guess what it's for... As the more cunning amongst you may have guessed, I want it to open a user's default mail client with the email address from the box above...
2
3768
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars = thisForm.elements.value; var arrExcludeVars = strExcludeVars.split(","); for (var j=0; j<arrExcludeVars.length; j++) { if (arrExcludeVars == strToCheck) return true;
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10667
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10422
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9222
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3885
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.