#1
|
||
|
Add text to body in phMailer
HI Guys,
i´m new to PHP but i love this phMailer script. My one question after hours of searching the web is how do i add variable outpts to the body of the mail. For example, if i add a new field called $companyname, and i want the message body to start with: From $companyname how do i do this? |
#2
|
||
|
Here is a good tutorial on php and web forms:
http://www.w3schools.com/php/php_forms.asp Read the above brief tutorial and then follow below... As for adding them into the body of the email phMailer sends, you will want to find the line: $message.="$yourmessage"; Basically, create a new line two lines above it and replace $yourmessage with your $_POST information. An example would look like: $message.="Company Name: $_POST['company_name']"; $message.="\n"; $message.="Another field: $_POST['field_name']"; $message.="\n"; $message.="$yourmessage"; Sorry if this is a bad explanation, im not to good at explaining things.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#3
|
||
|
It can be done other ways but that way is the easiest I know of.
$_POST['company_name']; assumes that you have named the html element company_name. Make sure you only name the element, don`t put ID's on them...that's an error in XHTML. $message.="Company Name: ".$_POST['company_name']; $message.="\n"; $message.="Another field:".$_POST['field_name']; $message.="\n"; $message.="$yourmessage";
__________________
|
#4
|
||||
|
Quote:
http://www.w3.org/TR/xhtml1/ Read sec 4.10 Quote:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#5
|
||
|
XHTML 1.4 does not allow that.
I tried it and it freaked out. It's lameness does not allow iFrames either which is stupid.
__________________
|
#6
|
||
|
That's extremely odd how they would deprecate the name element for xhtml 1.0 and then deprecate id for 1.4 and bring back name.
I can't comment on the iframe but if ID is going to be taken out i'd like to see some document that states it on w3's website. Not trying to call you out or anything but I can't find anything and i'd like to know where you heard that from.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#7
|
||
|
I'll find it, I can`t remember what DTD we were using. Let me look into it. I was pretty shocked when I saw it.
__________________
|
#8
|
|||
|
Quote:
__________________
|
#9
|
|||
|
I must be halucinating Scott. I swear I was getting "invalid property" when I assigned an ID to an input field. O-well looks like XHTML 1.1 accepts it.
Sorry to mislead. It still doesn`t support iframes though. I think it was because I had the ID in caps. Quote:
__________________
Last edited by atholon; 09-19-2008 at 11:16 AM. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PHmailer with 7 attachments getts error message and text but not attachments in email sent | Idiotsavant | phphq.Net Forums | 4 | 09-08-2010 06:02 PM |
phMailer - add Subject EntryField | rosdi | phphq.Net Forums | 0 | 04-30-2009 11:08 AM |
does any body have a clue??? | bigsmellyfart | Humor & Jokes | 0 | 06-17-2006 01:34 AM |
Body Piercing!! | Scorpion101 | Humor & Jokes | 4 | 07-31-2005 01:56 PM |
add text fields? | planetfall | phphq.Net Forums | 1 | 06-09-2005 06:29 PM |