Forum Moderators: coopster

Message Too Old, No Replies

Passing a variable into an email w/o a form

         

RussellC

6:24 pm on Dec 10, 2002 (gmt 0)

10+ Year Member



I have searched for this all over but I can't seem to find an answer. Is there a way to pass a variable to an email message without using a form.

For example, I want to have the variable $jobnumber to show in the message subject like this:

mail('somone@somewhere.com','Job # $jobnumber is finished.','Message Body.','From: me@somewhere.com');

Is this possible? If so, how do I accomplish this.

Thanks for the help.

andreasfriedrich

6:26 pm on Dec 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is:

mail('somone@somewhere.com',"Job # $jobnumber is finished.",'Message Body.','From: me@somewhere.com');

Andreas

jatar_k

6:26 pm on Dec 10, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>>Is there a way to pass a variable to an email message without using a form

exactly what is sending the email and where is it getting it's info from?

<added>nice andreas :)

toadhall

6:47 pm on Dec 10, 2002 (gmt 0)

10+ Year Member



If you haven't spotted it (Andreas is being modest again ;)) the difference is the use of double quotes around the Subject entry, needed to parse the variable.

RussellC

6:47 pm on Dec 10, 2002 (gmt 0)

10+ Year Member



Ahhhh double quotes! Thank you very much Andreas. You are the man.

andreasfriedrich

6:55 pm on Dec 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your welcome Russell.

If you can tell I´m bit on a high this evening since I finished my exams for this year :) So I´m sitting in front of my computer listening to punk rock really loud and posting strange things. Sadly I have to wait until tomorrow to party.

Andreas