FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need Help. Post - Mail script failure





Relentless
Can any please tell my why this script is failing?

Code:

<?php
$Title=$_POST['Title'];
$First_Name=$_POST['First_Name'];
$Last_Name=$_POST['Last_Name'];
$Company=$_POST['Company'];
$url=$_POST['url'];
$type=$_POST['type'];
$Phone=$_POST['Phone'];
$Email=$_POST['Email'];
$Confirm_Email=$_POST['Confirm_Email'];
$Budget_range=$_POST['Budget_range'];

$Web_Design=$_POST['Web_Design'];
$Multimedia=$_POST['Multimedia'];
$Website_Maintenance=$_POST['Website_Maintenance'];
$Graphic_Design=$_POST['Graphic_Design'];
$Search_Engine_Optimization=$_POST['Search_Engine_Optimization'];
$Other=$_POST['Other'];

$Internet=$_POST['Internet'];
$Radio=$_POST['Radio'];
$Newspaper=$_POST['Newspaper'];
$Magazine=$_POST['Magazine'];
$Advertisment=$_POST['Advertisment'];
$Word_of_mouth=$_POST['Word_of_mouth'];

$Details=$_POST['Details'];

$Subject="Quote From $Title $First_Name $Last_Name";

$body="
   Name:   $Title $First_Name $Last_Name
Company:   $Company
    URL:   $url

   Type:   $type
    Tel:   $Phone
  Email:   $Email
Confirm:   $Confirm_Email
 Budget:   $Budget_range

Interested in:
                Web Design:  $Web_Design
                Multimedia:  $Multimedia
       Website Maintenance:  $Website_Maintenance
            Graphic Design:  $Graphic_Design
Search Engine Optimization:  $Search_Engine_Optimization
                     Other:  $Other
               
How did you find us:
     Internet:  $Internet
        Radio:  $Radio
    Newspaper:  $Newspaper
     Magazine:  $Magazine
 Advertisment:  $Advertisment
Word of mouth:  $Word_of_mouth

Details:
$Details";

$to="My@emailaddress.com";

$from2="from@emailaddress.com";

mail($to,"$Subject",$body,"From: $from2\n");


It works if I change

Code:
$body="";

[/code]to something like
Code:
$body="test";


Any ideas?

No errors appear on the screen. i just don't receive the email..
Raidation
Does your host give your a POP3 email address? Are you even using Frihost?
rvec
try echo $body; what does that give?
Relentless
Raidation wrote:
Does your host give your a POP3 email address? Are you even using Frihost?


Thanks for your reply. but like I said.

If I change the contents of $body other than:
Code:

   Name:   $Title $First_Name $Last_Name
Company:   $Company
    URL:   $url

   Type:   $type
    Tel:   $Phone
  Email:   $Email
Confirm:   $Confirm_Email
 Budget:   $Budget_range

Interested in:
                Web Design:  $Web_Design
                Multimedia:  $Multimedia
       Website Maintenance:  $Website_Maintenance
            Graphic Design:  $Graphic_Design
Search Engine Optimization:  $Search_Engine_Optimization
                     Other:  $Other
               
How did you find us:
     Internet:  $Internet
        Radio:  $Radio
    Newspaper:  $Newspaper
     Magazine:  $Magazine
 Advertisment:  $Advertisment
Word of mouth:  $Word_of_mouth

Details:
$Details


E.g body="Test";

I receive an email.

There is something wrong with that text... no idea what as i have used things similar before!

And yes rvec i have got a POP3 account otherwise I wouldn't received the test email...
Relentless
Sorry to double post..

I just tried this and still no joy!


Code:

$line1="   Name:   $Title $First_Name $Last_Name\n";
$line2="Company:   $Company\n";
$line3="    URL:   $url\n\n";

$line4="   Type:   $type\n";
$line5="    Tel:   $Phone\n";
$line6="  Email:   $Email\n";
$line7="Confirm:   $Confirm_Email\n";
$line8=" Budget:   $Budget_range\n\n";

$line9="Interested in:\n";
$line10="                Web Design:  $Web_Design\n";
$line11="                Multimedia:  $Multimedia\n";
$line12="       Website Maintenance:  $Website_Maintenance\n";
$line13="            Graphic Design:  $Graphic_Design\n";
$line14="Search Engine Optimization:  $Search_Engine_Optimization\n";
$line15="                     Other:  $Other\n\n";
               
$line16="How did you find us:\n";
$line17="     Internet:  $Internet\n";
$line18="        Radio:  $Radio\n";
$line19="    Newspaper:  $Newspaper\n";
$line20="     Magazine:  $Magazine\n";
$line21=" Advertisment:  $Advertisment\n";
$line22="Word of mouth:  $Word_of_mouth\n\n";

$line23="Details:\n";
$line24="$Details\n";

$body="$line1$line2$line3$line4$line5$line6$line7$line8$line9$line10$line11$line12$line13$line14$line15$line16$line17$line18$line19$line20$line21$line22$line23$line24";
sonam
I don't see any mistake in your code but... Confused Maybe you can try to build $body step by step. For example you can try to get mail with few lines.

Code:
$body="
   Name:   $Title $First_Name $Last_Name
Company:   $Company
    URL:   $url" ;


If you get that then try to extend for next few lines, and you will see where is mistake. If you didn't get this first few lines then maybe you must build $body without variables in double quotes.

Code:
$body='
   Name:' .  $Title . " " . $First_Name . " " . $Last_Name . '<br />
Company:' .  $Company . '<br />
    URL:' .  $url;


Sonam
rvec
Quote:
There is something wrong with that text... no idea what as i have used things similar before!

And yes rvec i have got a POP3 account otherwise I wouldn't received the test email...

Quote:
try echo $body; what does that give?

So what did you say was in there?
Relentless
FIXED IT!

DIDN'T CHECK MY JUNK MAIL! Embarassed

Thanks anyway guys

- please close -
sonam
Relentless wrote:
FIXED IT!

DIDN'T CHECK MY JUNK MAIL! Embarassed

Thanks anyway guys

- please close -


He, he, this is realy funny. Laughing

Sonam
Related topics
Looking for easy FormMail Script
Need help making logout script
Need help with PHP script[RESOLVED]
form mail problems (quality help=frih$)
need help with a script for vb its not to hard i think
Need help with mail.everyone.net
[PhP] News Posting Tutorial (code, actually ^^')
Simple and Detailed Mail Script
Need help with php script
Form To Mail Script
I need PHP script
Can You Get HTML in Your PHP Mail Script?
Need help with logger script. (half done)
Email form script - 50 FRIH$
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.