ajsuk Posted January 6, 2007 Share Posted January 6, 2007 Hey there, I'm having trouble doing what I want to do with emailing some form results.I know that you can include results as variables with no trouble but the problem comes for me because some of my form results have to be processed with if statements and so on meaning its not always just a direct dump from the form field for example. I'm guessing I need to be using a function or something? I've tried messing with them but I can't seem to get the email message to accept/include anything other than variables and static text.Any help would be greatly appreciated!Thanks in advance,Andy. =) Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted January 6, 2007 Share Posted January 6, 2007 Any clues to your actual problem would be even more welcome. A bit of code perhaps? or maybe a prediction as to when it will rain next in Paris? anything, anything at all.... Quote Link to comment Share on other sites More sharing options...
ajsuk Posted January 6, 2007 Author Share Posted January 6, 2007 Well I would of posted something but its all in my head at the moment.I havn't really a clue what how to do what I want and so havn't got any examples however I'll throw in what little I think is right...[code]function agecheck() {if ($age < 21) echo $age."(Under age)";else echo $age; }$to = "someone@hotmail.com";$subject = "Test mail";$message = "Here are the results: $firstname $lastname of agecheck() years old...";$from = "someonelse@hotmail.com";$headers = "From: $from";mail($to,$subject,$message,$headers);echo "Mail Sent.";[code][/code][/code] Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted January 6, 2007 Share Posted January 6, 2007 why not just parse the information before the mail()?[code=php:0]if ($age < 21) { $age .= ' (Under age)';}$to = "someone@hotmail.com";$subject = "Test mail";$message = "Here are the results: $firstname $lastname of $age years old...";$from = "someonelse@hotmail.com";$headers = "From: $from";mail($to,$subject,$message,$headers);echo "Mail Sent.";[/code]oh[quote author=ToonMariner link=topic=121297.msg498371#msg498371 date=1168117532]Any clues to your actual problem would be even more welcome. A bit of code perhaps? or maybe a prediction as to when it will rain next in Paris? anything, anything at all....[/quote]Maybe monday (30% chance) Quote Link to comment Share on other sites More sharing options...
ajsuk Posted January 6, 2007 Author Share Posted January 6, 2007 [quote author=genericnumber1 link=topic=121297.msg498394#msg498394 date=1168119008]why not just parse the information before the mail()?[/quote]Well, because that'd be too simple/smart for this poor php noob. ;)Thanks alot! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.