473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

An e-mail question using PHP

Chrisjc
375 256MB
I have the following code... My issue is I have submited this form about ten times and have not recived and E-mail to the current address below any ideas?

If someone could look this over and let me know.

Thanks!


[PHP]<?php

require_once ("conversionTable.php");

// extract the email address. Since this is validated it will be present
$email_to = $_POST['chrisj951@yahoo.com'];
$email_text = '';
$email_subj = 'Special Offer Form';
$email_hdrs = '';

// -----------------------------------------------------------------------------
// Process each heading and its form name arrays and store the formatted
// overview in the variable $email_text.
// -----------------------------------------------------------------------------
foreach($Headings as $heading => $formnames) {

// print the heading line
$email_text .= "<br> <br>$heading:";

// now loop through the formnames sub-array and print the field name and its value
foreach ($formnames as $fieldname) {

$fieldvalue = htmlentities($_POST[$fieldname]);

if (array_key_exists($fieldname, $conversion_table)) {
$tabel = array();
for ($i=0; $i<count($conversion_table[$fieldname]);$i++) {
array_push ($tabel,$conversion_table[$fieldname][$i] );
}
$label = $tabel[0]; // set description
if ($label <> "ignore") { // field to be ignored?
if ($tabel[1] == "*") // get value from $_POST array value?
$answer = $fieldvalue; // yes: get value from $_POST array
else { // no: get value from conversion table
$ents = (count($tabel)-1)/2; // no of 2-part entries
for ($j=0,$i=1; $j<$ents; $j++,$i+=2) {
if ($fieldvalue == $tabel[$i]) { // compare value (1st part)
$answer = $tabel[$i+1]; // true: get value from 2nd part
break; // break out of FOR loop
} // End IF
} // End FOR
} // End ELSE
} // End IF <> ignore
} // End IF array_key_exists
else { // name not in conversion table:
$label = $fieldname; // display form name
$answer = $fieldvalue; // and form value
} // End ELSEIF array_key_exists

if ($label <> "ignore" && $answer != "") {
$email_text .= "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$label." : ".$answer;
$answer = "";
} // End IF <> ignore

} // End FOREACH ($formnames)

} // End FOREACH ($Headings)

// ================================================== =============================
// Now all information is stored in the $email_text variable. Handle it
// ================================================== =============================
if ($email_text == "")
echo "<p style='font-family:tahoma;font-weight:bold;text-decoration:underline;font-size:14px;'>No form input to send</p>";

else {
// print the information on the screen
echo "<p style='font-family:Tahoma;font-size:12px;'>$email_text</p>";

// build and send the information in an e-mail message
// translate the indentation chars to blanks and the breaks to newlines
$email_text = str_replace(array("<br>", "&nbsp;"), array("\n", " "), $email_text);
$email_subj = "This is a confirmation of your aFe purchase";
$email_hdrs = "From: ronald@goosen-verdonk.nl\n";
if (mail($email_to, $email_subj, $email_text, $email_hdrs))
echo "Mail successfully sent";
else
echo "Mailing error!";
}


?>
[/PHP]
Sep 7 '07 #1
1 1042
Chrisjc
375 256MB
Someone please delete this entire thing I figured it out.. sorry I forgot something haha
Sep 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: James | last post by:
How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is a drop down list FROM: this is a drop down...
1
by: JSzucs | last post by:
I wrote a little code snipet in Asp.Net to send a default message to my outlook email address. That works fine, since the SMTP virtual server default domain is same domain as my outlook mail...
0
by: Brad Pears | last post by:
Our web site is hosted on our providers site where ASP is installed. On our website, we generate an email containing personal data including credit card info whenever someone orders a product...
11
by: Mohammed Abdel-Razzak | last post by:
dear sirs i want to send email using c# but i don`t want to use CDONTS or tell me how can i use it i don`t know any thing about CDONTS thanks
3
by: Srinivas | last post by:
Hi, I am using ASP.NET SmtpMail to send email using the following code public void SendEmail(string From, string To, string Subject, StringBuilder Message, string Attachment, string...
0
by: Phil Endecott | last post by:
Dear PostgreSQL people, I thought that some of you might be interested to know about Decimail, a new IMAP mail server that I've written that uses PostgreSQL to implement its message store. ...
6
by: ttamilvanan81 | last post by:
Hai. I needto Receive Email using Ms-Access and Outlook. On the receiving end, the user receives the email at the Outlook. When they opens the Email, the message box should have a button called...
4
Frinavale
by: Frinavale | last post by:
Introduction Many .NET applications will require an email be sent out for various reasons. This article will give a quick examples on how to send an email using VB.NET. The examples given can...
4
by: peter smith | last post by:
Hi all. We already use the SMTP features in .NET for sending SMTP email, but how can you receive SMTP email using the .NET framework. Basically we need to catch email from a given address and...
5
by: WaluigiCubed | last post by:
Hello everyone: I've been working on making some changes to the website for the company that I am currently an intern for. There is a function that they have in one of their files that uses...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.