well for a start I suggest spaces... makes a code easier to understand

$subject = "Need Help";

I am not sure if that actually affects the variable... anyway

mail($Email_To, $Email_Subject, $Email_Message,
                 "From: [EMAIL PROTECTED]\r\n"
                ."Reply-To: [EMAIL PROTECTED]\r\n")
            OR DIE( "Unable to send email" );

Thats an example of mail(); lifted from one of my scripts. As you can see,
the additional headers (Such as who the email is from) have to be writen as
"From: [EMAIL PROTECTED]\r\n". In your case, something like

$Email_From = "\"From: ".trim($sender)."\r\n\"";

should give you "From: $sender" as is needed.

As for using variables in the message... I suggest putting the variables
'outside' the message body.

EG: $Message = "Hello, this is my variable".$variable."\n\nIts nice";

I can't think of a good way to explain this... so think of ".$variable." as
a way of making php parse $variable. It can also be used with functions, so
is quite handy to know

Oh well, I tried. Sorry its not a bit clearer

Stephen


----- Original Message -----
From: "Marie Monday" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 3:52 PM
Subject: [PHP-WIN] 2 Issues for Mail() in Win/PHP4-


> I'm a PHP newbie and have just installed php4.2.3 on WinNT 4.0 w/ IIS4.0
>
> Already have set the SMTP and sendmail_from in php.ini.
> 1). Mail function sends mail, except that none of the html form
> variables are parsed into the email body $message.
> The script  works fine run from another hosted (apache) webserver.   Is
> a config or script issue?
> 2). Received email message does not include the sender's email address
> from $txtemail form variable.
> Instead, it places their email address from the form in the message body
> first line.
> It is using the php.ini sendmail_from address.
>
> <?php
> {
> $recipient="[EMAIL PROTECTED]";
> $subject="Need Help";
> $message="$txtname submitted a helpdesk request by web form.
> A computer tech needs to contact $txtname shortly at $txtphone or by
> email at $txtemail regarding $txtproblem";
> $sender=$txtemail;
> mail(trim($recipient), trim($subject), $message, trim($sender));
> }
> ?>
>
> TIA,
> ~marie
>
>


----------------------------------------------------------------------------
----


> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to