Jump to content

if/else statments inside php mail


Andrew R

Recommended Posts

Hi there.

 

How would I put if/else statements inside an php mail.  For example how would I put the following inside the message variable? –

 

if (empty($age)) {

echo “No age submitted”;

}

 

 

$to = "$addy";
$subject ="Title";
$message = "



";

$headers = "From: $forname <$email>";

mail($to, $subject, $message, $headers);

 

Thank you  :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/110650-ifelse-statments-inside-php-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.