Jump to content

tg11

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tg11's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks a lot, I'll give that a try, I know it was working flawlessly up until a couple of days ago.
  2. thanks very much for replying. What was on the link I sent was this PHP on Windows Use the PHP mail function and set the mail from using the following line of code - replacing email@mydomain with the correct domain name. ini_set("sendmail_from", " email@mydomain "); So I am assuming that all I would need to do was to add it to my code like this, Is this right? thanks [code]<?php ini_set("sendmail_from", " enquiries@celebcars.co.uk"); // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "enquiries@celebcars.co.uk"; $Subject = "information request"; $Name = Trim(stripslashes($_POST['Name'])); $subject = Trim(stripslashes($_POST['subject'])); $comments = Trim(stripslashes($_POST['comments'])); // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (Trim($Name)=="") $validationOK=false; if (Trim($subject)=="") $validationOK=false; if (Trim($comments)=="") $validationOK=false; if (!$validationOK) {   print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";   exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "subject: "; $Body .= $subject; $Body .= "\n"; $Body .= "comments: "; $Body .= $comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){   print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.htm\">"; } else{   print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?>[/code]
  3. Hi all, Im looking for some advice regarding my email form on a website I did for somebody. I received an email asking me to make som adjustments to it. This is the code I was originally using that worked fine [code]<?php // Website Contact Form Generator // [url]http://www.tele-pro.co.uk/scripts/contact_form/[/url] // This script is free to use as long as you     // retain the credit link     // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "enquiries@celebcars.co.uk"; $Subject = "information request"; $Name = Trim(stripslashes($_POST['Name'])); $subject = Trim(stripslashes($_POST['subject'])); $comments = Trim(stripslashes($_POST['comments'])); // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (Trim($Name)=="") $validationOK=false; if (Trim($subject)=="") $validationOK=false; if (Trim($comments)=="") $validationOK=false; if (!$validationOK) {   print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";   exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "subject: "; $Body .= $subject; $Body .= "\n"; $Body .= "comments: "; $Body .= $comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){   print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.htm\">"; } else{   print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> [/code] but they said they updated their server and this is a fix here for it [a href=\"http://www.fasthosts.co.uk/knowledg.../?article_id=65\" target=\"_blank\"]http://www.fasthosts.co.uk/knowledg.../?article_id=65[/a] do I just need to add this line they suggest - ini_set("sendmail_from", " email@mydomain "); Im not sure where to add this to the code. Hope somebody can help Im totally lost on this.. thanks in advance Rob
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.