Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email form htm

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
Is it possible to format the message that is being sent from a form through php code. Right not it's just listing the different fields. Can I add a rule or any other html formatting to the type?

$subject = 'Team CSC Opportunity Registration Form';
$mailcontent = 'Opportunity Name: '.$name."\n"
.'Opportunity Description'."\n"
.'Work Description: '.$work."\n"
.'Opportunity Value: '.$ovalue."\n"

......etc
 
yes. format as you wish. just make sure to send in html with the right mime content types. consider using phpmailer as this makes life much easier.
 
Do you know where I can find examples of that kind of formatting?
 
When I try to put htm tags in the php code I got this returned in the email....


Opportunity<i>Name</i>: test
 
then you are not setting the content-type. for goodness sake follow my advice and use phpmailer.
 
I don't have phpmailer installed and the server isn't in this office. Besides I'm sending information to an emai and I also the same form sending information to a database. It all works but I just was told to try to format the type coming back in the email. I don't know what setting the content-type means. I've very new at this.
 
Sorry, I meant I don't have the mail() function installed on my server and the server isn't in the office.
 
the mail() function is built in to php. i was not aware that it could be uninstalled.
 
I can't combine that code with code for the database.
 
i have absolutely no idea what you are talking about.

why not start again. give lots of information, backed up with code. be explicit: don't assume that the words that you use to describe something are those used by the rest of the php community: instead _explain_ each item and each step you have taken.

if you cannot install phpmailer explain _why_ you cannot. the remoteness of the server should not be a reason as you can always log on to it.


 
Because I have to send the same information to a database from the same form. I don't think phpnmailer does that.
 
why should phpmailer do that? it's a mail class. it's up to you to write information to a database.

but simply using phpmailer or any other script does not magically evaporate a variable. variables (including superglobals - $_POST etc) are not use once and lose. there is nothing to stop you from sending an email and then reusing the variables to write to a database. Or even, the other way round.

phpmailer is _just_ a php script. it is not a separate application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top