This is a discussion on "Form Email Priority" within the PHP Forum section. This forum, and the thread "Form Email Priority are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Form Email Priority
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Form Email Priority
I have a form and one of the fields in it is a Priority selection.
When the High priority is selected I would like the email priority to be set to high - like you can in Outllook Express. Is this possible in PHP? |
|
|
|
#2
|
|||
|
|||
|
The fourth parameter of the PHP mail function is headers.
So you'll need something like this (taken from here):
|
|
#3
|
|||
|
|||
|
Hi thanks for this.
Unsure where to put in $Priority== Do I need to create an if statement for each priority value and put them inside a function? Somethinig like the code below I dont know php but let me know if I am thinking along the right lines
|
|
#4
|
|||
|
|||
|
Or you can use the switch function as explained in your other thread.
Also make sure that $priority in the function header has the same case as $Priority in the function body. |
|
#5
|
|||
|
|||
|
Ok I will give the switch function a try thanks.
How do you include the result of a function to an email message? For example: $message = "Thank you\n"; $message .= "i would like to add a switch function here: XXXXXX"; I cant figure out the proper typo ?? |
|
#6
|
|||
|
|||
|
If the function is using return, then simply call the function inside the string.
|
|
#7
|
|||
|
|||
|
Ok
How do I call a function inside a string? |
|
#8
|
|||
|
|||
|
Just call it...
function(parameters) |
|
#9
|
|||
|
|||
|
Why doesn't this work??
I have set up a function named Makeit which holds a Switch function. I want this to change the X-Priority: and so change to priority of the email. To do this I have attempted to create a variable $level = Makeit (); And the line: $mailheader .= "X-Priority: $level\n"; But there is no data applied to $level. It sends the email but the priority does not change. I have manualy tested the email priority change and it works. The problem is in calling the function . . please help it is doing my head in . . . . I am a complete programming numbskull
|
|
#10
|
|||
|
|||
|
Right
I sorted it by changing the switch funtions for if statments and thanks to Sirkent to write a function in a string:
|
![]() |
| Tags |
| form, email, priority |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP email form not sending email | Kurt | PHP Forum | 1 | Oct 12th, 2007 04:26 |
| Form submits to email via php, but email is blank!!?? | DH1234 | PHP Forum | 2 | Jun 18th, 2007 10:42 |
| Email form using asp | QuizToon | Classic ASP | 2 | Mar 28th, 2006 00:25 |
| Form to Email | daveycee | Web Page Design | 3 | Mar 16th, 2006 21:25 |
| php email form | djme | PHP Forum | 3 | Jan 1st, 2006 22:06 |