Author Topic: HTML code trough php not working in mail(box)  (Read 1008 times)

0 Members and 1 Guest are viewing this topic.

Offline cureheadedTopic starter

  • Irregular
  • Posts: 2
    • View Profile
HTML code trough php not working in mail(box)
« on: March 06, 2010, 05:55:45 AM »
Hi Guys,
I am at a loss, so I would like to ask for your help (first timer on a forum)
Situation:
I have a HTML(PHP) form with a lot of textfields. On submitting this a php script runs which creates a complex mail (HTML, attachements, ...) and sends it.
The method I use for (a part of) the body of the message is to create a string in php with the html tags (and using correct headers)

So the mail arrives and looks just the way I want it.
But here it goes wrong
this is a part of the html code I send:

$bl 
.= '<form id="admsend" name="admsend" method="post" action="mailto:me@myplace.xx">';
$bl .= '<input type="submit" name="sendadm" id="sendadm" value=" forward this form  " /></br>';
$bl .= '</form>';


so, it is your basic html mailto and it does show up as a clickable button, but is does not open a mailprog as it does when inside a brower.

Any ideas? ANY SUGGESTION is very welcome!!!

THANKS !!
C.

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: HTML code trough php not working in mail(box)
« Reply #1 on: March 06, 2010, 06:18:48 AM »
The action attribute needs to be a url.

Offline Dennis1986

  • Enthusiast
  • Posts: 78
  • Gender: Male
  • PHP for life!
    • View Profile
    • DennisRasmussen.dk
Re: HTML code trough php not working in mail(box)
« Reply #2 on: March 06, 2010, 07:07:54 AM »
Just ask and I'll answer your question(s)! ;)

Offline cags

  • Guru
  • Fanatic
  • *
  • Posts: 3,250
  • Gender: Male
    • View Profile
    • TiB Studios
Re: HTML code trough php not working in mail(box)
« Reply #3 on: March 06, 2010, 07:17:57 AM »
To clarify what thorpe and Dennis1986 are saying, it's not possible to to simply use a mailto link as the action on a form and make it send an e-mail, pre-fill in an e-mail etc. If you are using a form in that manner you will need to submit to a script on your page and use the mail function to send the actual e-mail, thus bypassing the users e-mail client. Alternatively you have a standard anchor link on your page with that title, which will open their e-mail client, this does not use a form at all.

For more detailed help we need more information to put the code you posted into context. Alternatively you can pick a ready made script for a few $'s if you wanted to for example Simple Feedback Form, or there are plenty of free tutorial about this around.
CodeCanyon - Cheap, High Quality, Ready Made Scripts.

Offline cureheadedTopic starter

  • Irregular
  • Posts: 2
    • View Profile
Re: HTML code trough php not working in mail(box)
« Reply #4 on: March 08, 2010, 06:25:49 AM »
Hello everybody,

first of all. thanks a lot for your reactions. I read them carefully. Now I am thinking I did not make myself very clear or maybe I don't understand all you helpful people are sayinf.

So I am working from a webpage ande that sends me an email. Inside that email there is a form(created by passing Html as a string through PHP) . Inside my mailbox it looks a little like this:
(see image)

and THEN I just want to press the button INSIDE by mailbox (not on the internet) - which should result in sending a mail (or opening a new mail window with (only) this form as message.

thank you for helping me out!
C.


[attachment deleted by admin]

Offline burunduk

  • Irregular
  • Posts: 2
  • Gender: Male
    • View Profile
Re: HTML code trough php not working in mail(box)
« Reply #5 on: March 12, 2010, 11:15:02 AM »
I'll show you a special tutorial resource on the various web forms, including and email  forms too. This resource (php form tutorials) probably have the answer to your question. Good luck.