Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail() ..All works fine except "from" ??

Status
Not open for further replies.

Curisco

Programmer
Feb 6, 2002
90
SE
Can some one please ease my pain.. i've finally got it all to work and then i realise that using "from" nothing happens.
Without the "from" it returns with "nobody"
nobody <nobody@
without the &quot;from&quot; sending it is ok, To add to it all on refresh, the empty form sends directly..

confused ..so am i

the code:
Code:
<?
//
$msg = &quot;E-mail sent from my site\n\n&quot;;
$msg .= &quot;sender_F Name:    &quot;.$_POST['sender_Fname'].&quot;\n&quot;;//name of input fields
$msg .= &quot;sender_E Name:    &quot;.$_POST['sender_Ename'].&quot;\n&quot;;
$msg .= &quot;sender_Adress:      &quot;.$_POST['sender_Adress'].&quot;\n&quot;;
$msg .= &quot;sender_Pnum:      &quot;.$_POST['sender_Pnum'].&quot;\n&quot;;
$msg .= &quot;sender_Ort:      &quot;.$_POST['sender_Ort'].&quot;\n&quot;;
$msg .= &quot;sender_TelNum:      &quot;.$_POST['sender_TelNum'].&quot;\n&quot;;
$msg .= &quot;sender_Fax:      &quot;.$_POST['sender_Fax'].&quot;\n&quot;;
[COLOR=red]$msg .= &quot;sender_Email:  &quot;.$_POST['sender_email'].&quot;\n\n&quot;;[/color]
$msg .= &quot;lagenhet_kvm:      &quot;.$_POST['lagenhet_kvm'].&quot;\n&quot;;
$msg .= &quot;lagenhet_rum:      &quot;.$_POST['lagenhet_rum'].&quot;\n&quot;;
$msg .= &quot;lagenhet_Toa:      &quot;.$_POST['lagenhet_Toa'].&quot;\n&quot;;
$msg .= &quot;lagenhet_beds:      &quot;.$_POST['lagenhet_beds'].&quot;\n&quot;;
$msg .= &quot;lagenhet_kok:      &quot;.$_POST['lagenhet_kok'].&quot;\n&quot;;
$msg .= &quot;lagenhet_fonster:      &quot;.$_POST['lagenhet_fonster'].&quot;\n\n&quot;;
$msg .= &quot;flytt_Tid:      &quot;.$_POST['flytt_Tid'].&quot;\n\n&quot;;
$msg .= &quot;flytt_ovriga:      &quot;.$_POST['flytt_ovriga'].&quot;\n&quot;;

[COLOR=red] $from = &quot;$sender_email&quot;[/color] 
$to = &quot;mpro02@hotmail.com&quot;;

$subject = &quot;Flyttstädning  - Kontakt Form \n&quot;;
$mailheaders = &quot;Flyttstädning  - Kontakt Form \n&quot;;
$mailheaders .= &quot;Reply-To: $sender_email\n\n&quot;;
$from = &quot;$sender_email&quot;;
mail($to, $subject, $msg, $mailheaders, $from);
//header( &quot;Location: [URL unfurl="true"]http://www.abss.nu/thankyou.htm&quot;[/URL] );
?>
What's happnin'?
Some help would really be appreciated
Thanks
/R

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
I suspect that there is some SMTP mail filter on ur server, but i am not sure.
test the code by giving some valid 'from' email address.




--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Thanks for your time Spookie,
i've tried that and that's the result &quot;nobody&quot;.
i've tried ringing the isp but of course thier closed over Christmas.
Back to Google i'm afraid.

Thanks again
/R

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
I usually put the from parameter in the header.
For Example:

$subject = &quot;Flyttstädning - Kontakt Form \n&quot;;
$mailheaders = &quot;Flyttstädning - Kontakt Form \n&quot;;
$mailheaders .= &quot;Reply-To: $sender_email\n\n&quot;;
$mailheaders .= &quot;From: Your Name <$sender_email>&quot;;
mail($to, $subject, $msg, $mailheaders);
 
Thanks Westbury for your time,
Being new at this, it seems as though i'm in a catch 22 situation ... If i knew what i were looking for, then the task of searching would be alot easier. After many hours i managed to solve that problem which of course leads me straight into another. Hence my question involving validation and the aplication, of which aludes me still. (Mail() +submit etc.).
By the way, curiosity brings me to ask is there a difference in the way you solved it to the way i managed to
cut and paste my way through.

The code and the following question is in the thread entitled:
Mail() +submit etc.
Once again i thank you and any thoughts will be greatly accepted and appreciated.

/R


-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top