Calling functions in mail message

This is a discussion on "Calling functions in mail message" within the PHP Forum section. This forum, and the thread "Calling functions in mail message are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 24th, 2005, 09:09
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Calling functions in mail message

I am trying to call a function within an email message

It just writes the words not the actual function value. Do I need a $ before it or something?? I dont know man

I have this:

Code: Select all
$message = "Thank you\n"; 
$message .= "Your request will be dealt with in: Plevel() \n";
It sends email like this:

Quote:
Thank you
Your request will be dealt with in: Plevel()
I have tried various combinations, moving things around, I havent got a clue . .

-

The Function is set up like this:

function Plevel($Priority)
{
if ($Priority=="Level 1") echo"12 hours";

if ($Priority=="Level 2") echo"24 hours";
}

-
Reply With Quote

  #2 (permalink)  
Old Aug 24th, 2005, 17:21
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Try:
Code: Select all
$message .= "Your request will be dealt with in: ".Plevel()."\n";
But your function should really use 'return' instead of 'echo'.
Reply With Quote
  #3 (permalink)  
Old Aug 24th, 2005, 18:47
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks man I got it, I got it,
sorry for being a long winded arse on this one, used to dealing with asp and I thought php would be straight forward. There are a lot more symbols to organise.
AK
Reply With Quote
Reply

Tags
calling, functions, mail, message

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling functions in a function fatsurfer PHP Forum 1 Jun 12th, 2008 21:53
Calling functions with variable? CloudedVision JavaScript Forum 1 Apr 18th, 2008 08:44
Calling functions thriftyspider Classic ASP 5 Aug 7th, 2007 14:54
Sending Mail, Body message from database chlad Classic ASP 3 Nov 16th, 2006 04:05
Calling functions between frames apparentlyso JavaScript Forum 0 Oct 18th, 2006 21:07


All times are GMT. The time now is 06:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43