A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: ini_set problems

  1. #1
    Grandfather to the stars bigginge's Avatar
    Join Date
    Oct 2003
    Location
    UK
    Posts
    735

    ini_set problems

    I've got a nice contact form working in my own webspace, but when I try it in the client's it won't work. I believe this to be an anti-spam feature from the ISP. He sent me this:
    3) A fifth parameter -f should be added to the sendmail function. This will set the name of the from email address.
    In its basic form, a simple sendmail script will look like this:
    <?php
    ini_set("sendmail_from", " user@yourdomain.com ");
    mail($email_to, $email_subject, $email_message, $headers, '-fuser@yourdomain.com');
    ?>
    Provided that you set the sendmail variable, before attempting to send the email. Specify the from address as a fifth parameter in the sendmail function, and the email is either to, or from, a Mooncomputers hosted email address you should have no problems.

    The PHP script I'm now using is:
    PHP Code:
    <?  

    // Enter your email address here
    $adminaddress = "you@yourdomain.co.uk"; 

    // Enter the address of your website here MUST include http://www. 
    $siteaddress ="http://www.yourdomain.co.uk"; 

    // Enter your company name or site name here 
    $sitename = "Company Name"; 

    // Gets the date and time from your server
    $date = date("m/d/Y H:i:s");

    // Gets the IP Address
    if ($REMOTE_ADDR == "") $ip = "no ip";
    else $ip = getHostByAddr($REMOTE_ADDR);

    //Process the form data!
    // and send the information collected in the Flash form to Your nominated email address
    IF ($action != ""): 
    mail("$adminaddress","Info Request", 
    "FAO: Admin @ $sitename \n
    Name: $fname 
    Email: $vemail
    Phone: $vephone
    Company: $cname
    The visitor commented:
    ------------------------------
    $comments
    ------------------------------

    Logged Info :
    ------------------------------
    Using: $HTTP_USER_AGENT
    Hostname: $ip
    IP address: $REMOTE_ADDR
    Date/Time:  $date","FROM:$adminaddress"); 


    //This sends a confirmation to your visitor
    mail("$vemail","Thank You for visiting $sitename", "Hi $fname,\n
    Thank you for your comments on your visit to $sitename!\n

    $sitename
    $siteaddress","FROM:$adminaddress"); 

    //Confirmation is sent back to the Flash form that the process is complete
    $sendresult = "Done!";
    $send_answer = "answer=";
    $send_answer .= rawurlencode($sendresult);
    echo "$send_answer";

    ENDIF;
    ?>
    How would I combine the 2 scripts, please.
    To dance beneath the diamond sky with one hand waving free
    Love Light Romania Romania Blog

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    Wouldn't that be:
    PHP Code:
    <?  

    ini_set("sendmail_from", " user@yourdomain.com ");

    // Enter your email address here
    $adminaddress = "you@yourdomain.co.uk";

    // Enter the address of your website here MUST include http://www.
    $siteaddress ="http://www.yourdomain.co.uk";

    // Enter your company name or site name here
    $sitename = "Company Name";

    // Gets the date and time from your server
    $date = date("m/d/Y H:i:s");

    // Gets the IP Address
    if ($REMOTE_ADDR == "") $ip = "no ip";
    else $ip = getHostByAddr($REMOTE_ADDR);

    //Process the form data!
    // and send the information collected in the Flash form to Your nominated email address
    IF ($action != ""):
    mail("$adminaddress","Info Request",
    "FAO: Admin @ $sitename \n
    Name: $fname
    Email: $vemail
    Phone: $vephone
    Company: $cname
    The visitor commented:
    ------------------------------
    $comments
    ------------------------------

    Logged Info :
    ------------------------------
    Using: $HTTP_USER_AGENT
    Hostname: $ip
    IP address: $REMOTE_ADDR
    Date/Time:  $date","FROM:$adminaddress", '-fuser@yourdomain.com');


    //This sends a confirmation to your visitor
    mail("$vemail","Thank You for visiting $sitename", "Hi $fname,\n
    Thank you for your comments on your visit to $sitename!\n

    $sitename
    $siteaddress","FROM:$adminaddress", '-fuser@yourdomain.com');

    //Confirmation is sent back to the Flash form that the process is complete
    $sendresult = "Done!";
    $send_answer = "answer=";
    $send_answer .= rawurlencode($sendresult);
    echo "$send_answer";

    ENDIF;
    ?>
    ?

  3. #3
    Grandfather to the stars bigginge's Avatar
    Join Date
    Oct 2003
    Location
    UK
    Posts
    735
    Thanks for your reply, Nunomira, and sorry I duplicated the question, but this has been doing my head in for 3 days now and I can't figure it out.
    I amended the script but it's still not working. Is there anyway I can find out why the emails aren't being sent?
    To dance beneath the diamond sky with one hand waving free
    Love Light Romania Romania Blog

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    Try the code they gave you (mail() function).
    Start with a very simple example and make sure it works.
    Start replacing the variables, one by one, until you reconstruct your code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center