Forum Moderators: coopster

Message Too Old, No Replies

PHP Mailform with HTML design

         

zoid

3:44 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



Hi there I have a simple php mail form, that looks like this:

$mymail = "tuCorreo@example.com";
$subject = "Formulario: Trabaja con nosotros";
$contenido = $_POST["nombre"]." Escribio :\n";
$contenido .= $_POST["mensaje"]."\n\n";
$header = "From:".$_POST["mail"]."\nReply-To:".$_POST["mail"]."\n";
$header .= "X-Mailer:PHP/".phpversion()."\n";
$header .= "Mime-Version: 1.0\n";
$header .= "Content-Type: text/HTML";
mail($mymail, $subject, utf8_decode($contenido) ,$header);
echo "&estatus=ok&";

( I can't post the entire code, don't know why :?, so that it's only a portion)

It's that way because Macromedia Flash send the vars to it, but I want to put the answer, I mean the php returning mail, formated on a nice HTML design...

Is that possible? I'm a newbie with PHP, so any suggestions or comments will be so much apreciated.

Thanks a lot in advance!

[edited by: coopster at 5:21 pm (utc) on July 7, 2005]
[edit reason] generalized email [/edit]

ergophobe

7:25 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld zoid.

Sorry, but I'm not sure I follow what you want to do. Do you want to send a response message that would be in HTML format? Do you want to show the current message as a confirmation, and have that on your web page.

mcibor

7:28 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's no problem for php to write emails containing html. Just put your content into $contenido and it will work:

$contenido = "<table><tr><td width=\"50%\">Nombre</td><td width=\"50%\">Indirizzo</td></tr>
<tr><td>$name</td><td>$adress</td></tr></table>";

And you have a html formatted mail
Best regards
Miguel Cibor

If it's not the problem, then write, as I might have misunderstood what the problem was.

PS. Any problems with sending larger chunks of text are firewall related (I have the same problem until I exit my firewall, don't know why however)

zoid

8:20 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



First of all thanks a lot for the answers, sorry about my english, I couldn't explain myself very well but mcibor just answered my question, were that exactly, how to put HTML code in the php mail form, and I think that I have understood it well, so if I could do it, I'll tell you.

Thanks a lot once more, by the way, this forum rocks, you all are php genious ;)

I apreciate a lot the help, thanks!

ergophobe

8:45 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



got it! It was the "returning mail" that confused me. Glad you have it sorted.

zoid

12:06 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



OMG! Thanks a lot! you guys rock! that worked simply perfect! woah, what a difference between sendeng a plain/text form instead of that wonderful HTML forms ^_^

THANKS THANKS THANKS, see ya on the forums ;)