Sunday, 15 May 2011

php - If statement inside html email markup -



php - If statement inside html email markup -

i want utilize if statement within html markup.

but when send mail, "type" empty, doesn't send @ all.

is right way utilize if else statement within html email markup?

$e_body = "er contact opgenomen door $name." . php_eol . php_eol; $e_content = "<br><br> gegevens:<br> naam: $name <br> e-mail: $email <br> tel: $phone <br>"; if(isset($_post['werkzaamheden'])){ 'type: $select <br>'; }else{ 'type: niet van toepassing'; }" " . php_eol . php_eol; $e_reply = " onderwerp: $email2 <br> $commentsb<br> "; } $msg = wordwrap( $e_body . $e_content . $e_reply, 70 );

you need concatenate strings. instead of:

if(isset($_post['werkzaamheden'])){ 'type: $select <br>'; }else{ 'type: niet van toepassing'; }"

you should have

if(isset($_post['werkzaamheden'])){ $e_content .= 'type: $select <br>'; }else{ $e_content .= 'type: niet van toepassing'; }"

php html email

No comments:

Post a Comment