| View previous topic :: View next topic |
| Author |
Message |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Wed Aug 13, 2003 4:01 pm Post subject: ......... |
|
|
| No matter what i put in vds the email is always the same , the email is what i have on my server in the php ..... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 13, 2003 7:07 pm Post subject: |
|
|
You need to parse the input in PHP and assign the values transmitted to the appropriate PHP variables
to be sent off in your mail. It sound like you've got your variables hardcoded.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Wed Aug 13, 2003 7:47 pm Post subject: ... |
|
|
please remember <-- newbie , I hate to keep asking everyone to Give me everything : .... Please explain a lil bit |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 13, 2003 9:40 pm Post subject: |
|
|
You could try a PHP script something like this:
| Code: |
<?php
echo "<html><body>";
$mailto = "address@yourserver.com";
$from = "From: somebody@someserver.com\n";
$subject = $HTTP_GET_VARS['subject'];
$body = $HTTP_GET_VARS['body'];
// Send the email
if(mail("$mailto", "$subject", "$body", "$from")) {
echo "Mail sent!\n";
} else {
echo "Could not send email.\n";
}
echo "</body></html>";
?> |
Then call this script named e.g. "test.php" like this:
http://www.yourserver.com/test.php?subject=ErrorReport&body=SomeText
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Aug 14, 2003 12:49 am Post subject: |
|
|
Actually your code could be even easier. The variables are set when you
use the parameters in the URL. So you don't have to do any processing for
them. Same with POST, if your PHP version supports it, you don't have to
use $HTTP_POST_VARS['body']; or something like that.
| Code: |
<?php
echo "<html><body>";
$mailto = "address@yourserver.com";
$from = "From: somebody@someserver.com\n";
// Send the email
if(mail("$mailto", "$subject", "$body", "$from")) {
echo "Mail sent!\n";
} else {
echo "Could not send email.\n";
}
echo "</body></html>";
?> |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Thu Aug 14, 2003 3:12 am Post subject: ................ |
|
|
| that works great , is there anyway to do it hidden ,I tryed to do it RUNH but that dont work and shellh isnt a command .... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 14, 2003 5:26 am Post subject: |
|
|
| FreezingFire wrote: | Actually your code could be even easier. The variables are set when you
use the parameters in the URL. So you don't have to do any processing for
them. Same with POST, if your PHP version supports it, you don't have to
use $HTTP_POST_VARS['body']; or something like that.
| Code: |
<?php
echo "<html><body>";
$mailto = "address@yourserver.com";
$from = "From: somebody@someserver.com\n";
// Send the email
if(mail("$mailto", "$subject", "$body", "$from")) {
echo "Mail sent!\n";
} else {
echo "Could not send email.\n";
}
echo "</body></html>";
?> |
|
I don't think that that's gonna work on all PHP implementation, FF! But I'll check in out in a few minutes on
one of my own servers.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 14, 2003 5:40 am Post subject: |
|
|
Checked it out now. It's actually is a NO-GO with having those variables set automagically. They
must be declared on my server - PHP is not just PHP
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing
Last edited by Dr. Dread on Thu Aug 14, 2003 11:47 am; edited 1 time in total |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Thu Aug 14, 2003 11:20 am Post subject: |
|
|
This is what im using works fine
| Code: | <?php
echo "<html><body>";
$mailto = "@emaill.com";
$from = "From: error@email\n";
// Send the email
if(mail("$mailto", "$subject", "$body", "$from")) {
echo "Mail sent!\n";
} else {
echo "Could not send email.\n";
}
echo "</body></html>";
?> |
|
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Aug 14, 2003 10:21 pm Post subject: |
|
|
| Dr. Dread wrote: | Checked it out now. It's actually is a NO-GO with having those variables set automagically. They
must be declared on my server - PHP is not just PHP
Greetz
Dread |
It depends on the server configuration. Some servers that intend to have very high
security will disallow it. Still of course Dread's method will work no matter how the
server has configured PHP. |
|
| Back to top |
|
 |
|